Profile picture display in Heroku

Hi all, I have a rails application where users can upload profile
pictures. Now this all works perfectly fine.

Problem is I have recently uploaded my application to Heroku. It allows
me to upload the image and actually states in the box what the image is
but doesn’t display it as it can’t find the file.

Are there any methods to change this free of charge?

My code looks like the following in the user model:

has_attached_file :photo,
:default_url => ‘/images/guest.png’,
:url =>
“/assets/users/:id/:style/:basename.:extension”,
:path =>
“:rails_root/public/assets/users/:id/:style/:basename.:extension”

Just to confirm, the guest.png displays fine, but if I upload a picture
that is e.g. bear.jpg then at first it will display but if I come out of
the browser and then reload the page in the box it will say bear.jpg but
is broken.

On Sun, Apr 15, 2012 at 14:30, Christopher J. [email protected]
wrote:

I have recently uploaded my application to Heroku. It allows
me to upload the image and actually states in the box what the image is
but doesn’t display it as it can’t find the file.

Are there any methods to change this free of charge?

Not on Heroku itself. Heroku provides no local file storage, only
databases. You could set the files to be stored elsewhere, like on
Amazon S3 or some such, but IIUC that’s only free for a limited trial
period.

If anybody knows of good free secure cloud file storage, suitable for
use from Heroku apps, I’d like to hear about it too!

Thanks,
Dave


Dave A.: Available Cleared Ruby on Rails Freelancer
(NoVa/DC/Remote) – see www.DaveAronson.com, and blogs at
www.Codosaur.us, www.Dare2XL.com, www.RecruitingRants.com

On Sun, Apr 15, 2012 at 12:31 PM, Dave A.
[email protected] wrote:

        You could set the files to be stored elsewhere, like on

Amazon S3 or some such, but IIUC that’s only free for a limited trial
period.

Yeah, and then you’re stuck paying through the NOSE, man, like

US Standard Region
$0.125 per GB - first 1 TB / month of storage used
$0.01 per 1,000 PUT, COPY, POST, or LIST requests
$0.01 per 10,000 GET and all other requests

My monthly bill is 3 CENTS. Well, 4, since I started using SES (mail).
'S BRUTAL :slight_smile:


Hassan S. ------------------------ [email protected]

twitter: @hassan