使用 Plupload HTML5 运行时直接上传到 Amazon S3
我在上一篇文章中看到 如何制作 Plupload直接上传到 Amazon S3?,这可以从 Pluplod Html5 运行时直接上传到 S3。
我通过将我的“pluploader”托管到我的 S3 存储桶中尝试了您的方法,但我仍然收到来自亚马逊的错误
无法加载资源:服务器响应状态为 405(不允许方法) XMLHttpRequest 无法加载 http://xxxxxxxxx.s3.amazonaws.com/。 Access-Control-Allow-Origin 不允许来源 http://s3.amazonaws.com
有人吗那可以帮助我吗?谢谢
I saw in one a previous post How do I make Plupload upload directly to Amazon S3?, that this is possible to direct upload from Pluplod Html5 runtime to S3.
I tried your approach by hosting my "pluploader" into my S3 bucket but i am still receiving error from amazon
Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
XMLHttpRequest cannot load http://xxxxxxxxx.s3.amazonaws.com/. Origin http://s3.amazonaws.com is not allowed by Access-Control-Allow-Origin
Is there someone thar can help me ? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新:Amazon S3 现在支持跨源资源共享,因此现在应该可以进行 HTML5 上传。请参阅此处的文档: http://docs.amazonwebservices.com/AmazonS3/latest/ dev/cors.html 和原始帖子:https://forums.aws.amazon.com/message.jspa?messageID=377271 #377271
抱歉,亚马逊仍然不支持 HTML5 上传,因为它们不支持
Access-Control-Allow-Origin
标头。两年过去了,亚马逊在这个问题上仍然没有任何进展。在存储桶中托管 iframe 表单的旧方法仅适用于 HTML4 上传,不适用于 HTML5。
更多信息请点击这里:
https://forums.aws.amazon.com/thread.jspa?threadID=34281
此外,Plupload 人员提供的更多信息如下:
http://www.plupload.com/punbb/viewtopic.php?pid =2361#p2361
如果您想使用标准文件输入字段将文件上传到 S3,我建议您阅读本教程...否则您将不得不使用 Flash、Silverlight 等来上传。
http://aws.amazon.com/articles/1434?_encoding=UTF8& ;jiveRedirect=1
UPDATE: Amazon S3 now supports Cross-Origin Resource Sharing so HTML5 uploads should now be possible. See the docs here: http://docs.amazonwebservices.com/AmazonS3/latest/dev/cors.html and the original post here: https://forums.aws.amazon.com/message.jspa?messageID=377271#377271
Sorry, but Amazon still does not support HTML5 uploads because they do not support the
Access-Control-Allow-Origin
header. It's been 2 years and there is still no progress from Amazon in regard to this issue.The old method of hosting an iframe form in your bucket only works for HTML4 uploads, not with HTML5.
More info here:
https://forums.aws.amazon.com/thread.jspa?threadID=34281
Also, more info from the Plupload guys here:
http://www.plupload.com/punbb/viewtopic.php?pid=2361#p2361
If you want to upload a file to S3 using a standard file input field, I would recommend reading this tutorial... otherwise you'll have to use Flash, Silverlight, etc. to upload.
http://aws.amazon.com/articles/1434?_encoding=UTF8&jiveRedirect=1