简体   繁体   English

通过PaperClip上传到s3的图像未显示在我的rails应用中

[英]images uploaded to s3 via PaperClip not displaying in my rails app

I have a rails app that allows users to upload photos via paperclip to s3. 我有一个Rails应用程序,允许用户通过回形针将照片上传到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 查看图片属性的网址是: http : //s3.amazonaws.com/mybucket/thumbnail/imagename.png?12982847

How do I make my image display in my rails app? 如何在Rails应用程序中显示图像? and how do I change/hide the s3 url? 以及如何更改/隐藏s3网址?

Thanks~! 谢谢〜!

You need to set the ACL . 您需要设置ACL

Regarding the domain, you can setup a CNAME domain (can be any domain) which will point to your S3 bucket . 关于域,您可以设置一个CNAME域(可以是任何域) ,该将指向您的S3存储桶

are you using S3fox? 您在使用S3fox吗? if so, try setting the permissions on the folder so that anyone can read the file 如果是这样,请尝试在该文件夹上设置权限,以便任何人都可以读取该文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过本地打开的回形针将AWS S3图像上载到Rails,但不在生产环境中打开(Heroku) - AWS S3 Images Uploaded to Rails via Paperclip Opening Locally, but not in Production (Heroku) 回形针图像未在Rails应用中显示 - Paperclip images not Displaying in rails app 使用s3和Rails应用上的回形针上传两个图像 - Uploading two images using s3 and paperclip on rails app 如何使用重新处理将已上传的Paperclip图像调整为s3? (导轨) - How to resize already uploaded Paperclip images to s3 using reprocess? (Rails) Rails回形针不显示来自Amazon S3的上传图像 - Rails paperclip doesn't display uploaded images from Amazon S3 Rails 4 + Paperclip + Amazon S3:图像作为原始文件上传,但没有样式(拇指和中号) - Rails 4 + Paperclip + Amazon S3: images are uploaded as originals, but none in styles (thumb & medium sizes) Rails 4 +回形针+设计+ S3:图像未上传到S3? - Rails 4 + Paperclip + Devise + S3: Images not uploading to S3? 多个图像(嵌套)未通过回形针在Rails中的ruby中上传 - Multiple images(Nested) not getting uploaded via paperclip in ruby on rails 使用曲别针通过我的rails-app上传的一些图像未出现在heroku上 - Some images uploaded through my rails-app using paperclip not appearing on heroku Rails使用回形针调整上传图像的大小 - Rails resize uploaded images with Paperclip
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM