ruby on rails 3 - Heroku Deploy Images Reset -


i have rails app deployed heroku. has image uploads. after deployed heroku again, unable see old images uploaded.

is heroku reset images folder when app re-deployed? please tell me reason behind it.

background

heroku uses 'ephemeral file system', application architecture point of view should considered read-only - discarded dyno stopped or restarted (which, along other occasions, occurs after each push), , not shared between multiple dynos.

this fine executing code from, application data stored in database independent of dynos. however, file uploads presents problem, , uploads should not stored directly in dyno filesystem.

solution

the simplest solution use amazon s3 file upload storage solution, and, if using gem paperclip, natively supported within gem. there great overview article in heroku dev center using s3 , heroku (https://devcenter.heroku.com/articles/s3), leads article contributed thoughtbot (the developers of paperclip) on implemenation specifics within rails app (https://devcenter.heroku.com/articles/paperclip-s3)


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -