通过 PaperClip 上传到 s3 的图像未显示在我的 Rails 应用程序中
我有一个 Rails 应用程序,允许用户通过回形针将照片上传到 s3。虽然上传工作正常,但当我尝试显示图像时,我看到的只是图像名称...
<%= image_tag @user.photo.url(:thumbnail) %>
查看图像属性,网址为: http://s3.amazonaws.com/mybucket/thumbnail/imagename.png?12982847
如何使图像显示在 Rails 应用程序中? 以及如何更改/隐藏 s3 url?
谢谢~!
I have a rails app that allows users to upload photos via paperclip to s3. While uploading works fine, when I try to display the image all I see is the image name...
<%= image_tag @user.photo.url(:thumbnail) %>
looking at the image properties the url is: http://s3.amazonaws.com/mybucket/thumbnail/imagename.png?12982847
How do I make my image display in my rails app?
and how do I change/hide the s3 url?
Thanks~!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要设置 ACL。
关于域名,您可以设置一个CNAME域名(可以是任何域名)这将指向您的 S3 存储桶。
You need to set the ACL.
Regarding the domain, you can setup a CNAME domain (can be any domain) which will point to your S3 bucket.
你用的是S3fox吗?如果是这样,请尝试设置该文件夹的权限,以便任何人都可以读取该文件
are you using S3fox? if so, try setting the permissions on the folder so that anyone can read the file