1

I'm new to Rails and Heroku as well.

Following tutorials I succeed to upload my app to Heroku.

My app is enable us to upload csv file to uploads folder in public. So I can upload file in heroku deployed app and show table as I want.

But after 30 mins or so those files are removed automatically and showing error that no such file in public/uploads folder.

It is properly working on my local which is using sqlite3.

But heroku want to use psql for production mode so I changed production mode to use psql.

So if I upload csv file then it is stored in 'public/uploads' folder.

I think heroku app is automatically update to github repo even I didn't execute 'git push heroku master' command.

In my local repository files are stored but they are run on development mode.

How can I make upload functionality fully working?

Any help would be appreciate.

1
  • When using Heroku (or any hosting service) you need to upload to a bucket store like Amazon S3. It's easiest to do that using an attachment gem like Paperclip. Heroku has good docs here. Commented Sep 18, 2017 at 4:28

1 Answer 1

1

Ephemeral filesystem is just the way heroku works, as explained in the article - uploaded files will be removed when the instance is restarted.

What you should do is to upload those files for example to S3 (https://devcenter.heroku.com/articles/s3), you can achieve this with CarrierWave gem with Fog gem but there are other possibilities as explained in this thread here: https://www.reddit.com/r/rails/comments/2k9sq4/heroku_any_files_you_upload_will_not_be_saved/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.