使用aws-sdk通过浏览器将大文件上传到aws s3时出现问题 [英] issue in uploading large files to aws s3 through browser using aws-sdk

查看:452
本文介绍了使用aws-sdk通过浏览器将大文件上传到aws s3时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

借助此博客 http://www.cheynewallace.com/uploading-to-s3-with-angularjs/我确实设法将较小尺寸(<30MB)的文件上传到s3存储桶.但是在上传更大的文件(大于30MB)时,我遇到了一些问题.

With the help of this blog http://www.cheynewallace.com/uploading-to-s3-with-angularjs/ I did manage to upload the files of smaller size (<30MB) to the s3 bucket. But while uploading a bit larger file (above 30MB) I am facing some issue.

error:Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at 'https://s3.amazonaws.com/**' (Reason: CORS request failed).

我在文件上传过程中遇到此错误,即,它最初开始上传,但是稍后(例如,在15%或18%上传之后),它会触发CORS错误,并且文件上传又从0%开始

I am getting this error in the middle of file uploading i.e,initially it starts uploading ,but later (say after 15% or 18% uploaded) it is firing the CORS error and the uploading of file again starts from 0%

我是AWS S3的新手.如果我有任何疑问,请纠正我.

I am very new to AWS S3. Please correct me if I am asking anything wrong.

推荐答案

在Amazon s3上上传大文件时,此问题是常见问题.将大文件上传到亚马逊的推荐方法是将大文件分成小块.要上传文件,您可以使用此角度库.并要将文件划分为大块,可以遵循此示例示例..希望对您有帮助.

This issue is common issue while uploading large files on amazon s3. Recommended way for upload large files to amazon is divide your large files into small chunks. For uploading files, you can use this angular library. and for divide your files into chunks, you can follow this sample example.. I hope, this will help you.

这篇关于使用aws-sdk通过浏览器将大文件上传到aws s3时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆