I’ve deployed a test Ruby on Rails application on Heroku and so far I’m a bit confused coming from a Windows Server 2008 VPN background.
On Windows Server 2008, I had my application folder and would use IIS to host the ASP.Net MVC application. I could then access folders via code and image.Save(path) files to the disc.
How do people handle user uploads on Heroku hosted applications?
For example, I want to let people create an apartment listing on the site, and upload pictures of the apartment. How does this work in Heroku?
You don’t. Heroku has almost no provision of “app-local” storage, and the filesystem is read-only, except for the
/tmpdirectory, which is not guaranteed to be persisted, and in any case it is local for each dyne.You will have to upload the files to some cloud storage service (like S3 or CloudFiles etc). Usually you have gems at your command which will manage this for you (Carrierwave is a quite recent example).