简体   繁体   English

Heroku应用程序未在其他计算机上提取S3图像

[英]Heroku app not pulling S3 images on other machines

I recently added photo uploading to a web application that I'm hosting on heroku. 我最近将照片上传添加到了我在heroku上托管的Web应用程序中。 I'm using S3 for storage and it's working great, however when other users go onto the site, they see a photo missing icon rather than the photo. 我正在使用S3进行存储,并且运行良好,但是当其他用户访问该网站时,他们看到的是照片丢失图标,而不是照片。 On my machine however, I see the photos on the site. 但是,在我的机器上,我看到了网站上的照片。 Any clues as to what is happening? 关于正在发生什么的任何线索? Thanks! 谢谢!

When you upload your photos to s3 you need to set their access level to public using whatever s3 lib your using. 将照片上传到s3时,您需要使用您使用的任何s3 lib将照片的访问级别设置为公开。

Here's snippet from s3 api docs: 这是s3 api文档的摘录:

x-amz-acl The canned ACL to apply, to the object that is created after completing multipart upload. x-amz-acl要应用的罐装ACL,适用于完成分段上传后创建的对象。 For more information, go to REST Access Policy in the Amazon S3 Developer Guide. 有关更多信息,请转到Amazon S3开发人员指南中的REST访问策略。

Type: String 类型:字符串

Default: private 默认值:私人

Valid Values: private | 有效值:私有| public-read | 公众阅读| public-read-write | 公共读写 authenticated-read | 认证读| bucket-owner-read | 桶所有者阅读| bucket-owner-full-control 桶所有者完全控制

http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadInitiate.html http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadInitiate.html

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM