s3没有这样的密钥,指定的密钥不存在。从网址预览文档

时间:2017-05-23 23:30:36

标签: html ruby-on-rails amazon-web-services iframe amazon-s3

我正在使用paperclip,s3。我上传了一个word文档,现在我希望能够从数据库中预览它。我使用的是iframe。

enter image description here



<iframe src="<%= agreement.document.url(:small) %>" frameborder="0" width="400" height="400" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"> </iframe>
&#13;
&#13;
&#13;

总而言之,我得到了这个错误。我该如何预览word文档或pdf ??

更新: 我有pdf显示但是文档不想显示。 Word文档显示空白pdf显示,而word文档则询问我是否要下载文件。

因此,它没有显示word文档,而是要求我下载它。

这就是我改变了:

&#13;
&#13;
<iframe src="<%= agreement.document.url() %>" frameborder="0" width="400" height="400" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"> </iframe>
&#13;
&#13;
&#13;

所以现在我怎么能让单词文件有效?它是一个docx

1 个答案:

答案 0 :(得分:0)

存储桶名称不正确,或存储桶中不存在该文件。

如果您希望每个人都可以访问该文件,请确保该文件的权限是公开的。