Location of Rails application images and audio files

Asked 1 years ago, Updated 1 years ago, 96 views

Using Rails, we create an app that allows administrators to upload image and audio files and allow third parties to check them.
The simple feature is that you can see what you uploaded on the management screen on a different front page, but where do you usually put your files?

I use a gem called Carrierwave to upload files.The file is stored in the /public/uploads directory.

I don't know enough about this area yet. Even if I start the application in the production environment (heroku) and upload the file, it will be saved in this directory, right?
Is there any risk in that case?
Also, I found many ways to put files in the cloud such as Amazon S3, but is it better to put them in the cloud?
I would appreciate it if you could tell me about the benefits of cloud.

Thank you for your cooperation.

ruby-on-rails ruby amazon-s3

2022-09-30 13:46

1 Answers

Heroku deletes files when Dyno restarts and goes idle, so the only way is to use external storage like Amazon S3.

Even if you have a production environment on your own server or VPS, it's hard to predict the increase in file capacity if users can post video or audio data.


2022-09-30 13:46

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.