After redeploying, I lost the uploaded images in the directory
After redeploying, I lost the uploaded images in the directory. My project uses Spring Boot v3.1.2 + Java v17. This is the way I am currently using to store uploaded files
Solution:Jump to solution
If its the second one, that service storage is ephemeral, meaning that it will erase itself on every deploy/redeploy of that service
14 Replies
Project ID:
N/A
N/A
Are you using railway volumes?
Or are you storing ur files in a dir inside the service/dockerfile?
Solution
If its the second one, that service storage is ephemeral, meaning that it will erase itself on every deploy/redeploy of that service
And thats why the first one (volumes) exists.
I am currently using the second approach you mentioned. So, the solution would be either using railway volumes as you mentioned or storing the files in the cloud and saving the file paths in the database, right?
I am storing the uploaded images directly within my project
you got it
volumes are likely easier to set up
If I use the railway volumes option, do I have to pay an additional fee? My website serves very simple needs, so I'm currently using the Hobby package. I don't want to incur any additional costs. I would greatly appreciate everyone's response
yeah
Thank you for everyone's assistance. I think to avoid incurring additional fees, I will handle file uploads by storing them in Google Drive
not the best idea tbh, we would all recommend an s3 based storage solution like Cloudflare r2
I will explore the solution you suggested. Thank you very much