I'm using Paperclip to manage user-uploaded images on a site that is served entirely under HTTPS. In order to avoid the silly security warnings on IE7/IE8, I need to also serve these images over SSL. I typically render my images using something like the following:

2 Answers
2

s3_protocol: The protocol for the URLs generated to your S3 assets. Can be either ‘http’ or ‘https’. Defaults to ‘http’ when your :s3_permissions are :public_read (the default), and ‘https’ when your :s3_permissions are anything else.

@JoshPinter if i've loaded images via paperclip already and want to add the https to the url, how would tell paperclip that? Is there an option where I don't have to upload all my images again.
–
MoosaDec 9 '14 at 20:19

1

@Moosa You shouldn't have to re-upload them if you're just changing the protocol to use https. It should just work. Try it out and let me know.
–
Josh PinterDec 9 '14 at 23:20

1

@JoshPinter I tried it but it doesn't work - doesn't the has_attached code get called only during uploads? if so, how does it work on existing images?. However, even new uploads don't point to https. On S3, the image url shows as https but my site shows it as http. Not sure why. www.outfitadditions.com.
–
MoosaDec 10 '14 at 16:57

2

@Moosa Also, you'll see in the documentation that it defaults to 'http' when your :s3_permissions are :public_read. What are your :s3_permissions?
–
Josh PinterDec 10 '14 at 18:35