[英]Paperclip providing wrong URL when using S3
正确的网址是: http : //s3.dvulgsolucoes.com.br/folder/filename.png,而我正在获取此网址: http : //s3.dvulgsolucoes.com.br.s3.amazonaws.com/folder/ filename.png
config.paperclip_defaults = {
storage: :s3,
s3_credentials: {
bucket: 'bucketname.com.br',
access_key_id: '###',
secret_access_key: '###',
}
}
Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
Paperclip::Attachment.default_options[:path] = '/clients/dmg/:class/:attachment/:id_partition/:style/:filename'
您可以从回形针更改默认的URL和路径,在初始化程序上编辑paperclip.rb:
Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
您可以从Heroku检查此链接
https://devcenter.heroku.com/articles/paperclip-s3#configuration
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.