R
Railway15mo ago
dx_manh

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:
If its the second one, that service storage is ephemeral, meaning that it will erase itself on every deploy/redeploy of that service
Jump to solution
14 Replies
Percy
Percy15mo ago
Project ID: N/A
dx_manh
dx_manh15mo ago
N/A
Medim
Medim15mo ago
Are you using railway volumes? Or are you storing ur files in a dir inside the service/dockerfile?
Solution
Medim
Medim15mo ago
If its the second one, that service storage is ephemeral, meaning that it will erase itself on every deploy/redeploy of that service
Medim
Medim15mo ago
And thats why the first one (volumes) exists.
dx_manh
dx_manh15mo ago
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
Adam
Adam15mo ago
you got it volumes are likely easier to set up
dx_manh
dx_manh15mo ago
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
Medim
Medim15mo ago
yeah
Medim
Medim15mo ago
dx_manh
dx_manh15mo ago
Thank you for everyone's assistance. I think to avoid incurring additional fees, I will handle file uploads by storing them in Google Drive
Brody
Brody15mo ago
not the best idea tbh, we would all recommend an s3 based storage solution like Cloudflare r2
dx_manh
dx_manh15mo ago
I will explore the solution you suggested. Thank you very much
Want results from more Discord servers?
Add your server