Ner*_*han 3 reactjs aws-amplify
我正在使用最新版本的 aws/amplify 3.3.7
这是代码
const s3Upload = async (file, id) => {
const filename = file.name.replace(/\s/g, '')
await Storage.vault.put(filename, file, {
contentType: file.type
})
}
Run Code Online (Sandbox Code Playgroud)
当我尝试上传小文件(1 Mb zip 文件)时,它工作正常,但是当我尝试上传较大文件(即 6 Mb zip 文件)时,我收到错误:
AWSS3ProviderManagedUpload - error happened while finishing the upload. Cancelling the multipart upload Error: Request failed with status code 40
Run Code Online (Sandbox Code Playgroud)
有人遇到过这个问题吗
小智 5
我遇到了同样的问题,大约 5MB 后,Amplify 使用分段上传,但失败并出现相同的错误。
对我来说修复是https://github.com/aws-amplify/amplify-js/issues/61
我将 ETag 添加到 S3 存储桶的 CORS 设置中的 ExposeHeaders 中,之后上传 10 MB 文件效果很好。
| 归档时间: |
|
| 查看次数: |
1766 次 |
| 最近记录: |