Is it possible to configure Paperclip to produce HTTPS urls for S3?

前端 未结 2 1473
谎友^
谎友^ 2020-12-14 14:47

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

2条回答
  •  醉梦人生
    2020-12-14 14:59

    You simply need to add:

    :s3_protocol => :https
    

    This is covered in the documentation.

    There are a few S3-specific options for has_attached_file:
    ...

    • 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.

提交回复
热议问题