amazon-web-services - AWS S3 createPresignedPost与getSignedUrl。我应该使用哪一个从客户端上传各种文件?

标签 amazon-web-services amazon-s3 file-upload aws-sdk

在S3文档上,存在createPresignedPostgetSignedUrl

在getSignedUrl上:

Note: Not all operation parameters are supported when using pre-signed URLs. Certain parameters, such as SSECustomerKey, ACL, Expires, ContentLength, or Tagging must be provided as headers when sending a request. If you are using pre-signed URLs to upload from a browser and need to use these fields, see createPresignedPost().



是createPresignedPost只是getSignedUrl的更可定制的版本吗?
它在下面做同样的事情吗?

最佳答案

如果要限制用户上传超出特定大小的文件,则应使用createPresigendPost,并指定ContentLength

使用getSignedUrl时,对象大小没有限制,用户可以将5TB对象(当前对象限制)上载到s3

请注意,如果您可以在调用getSignedUrl('putObject',params,callback)时在params中指定ContentLength
你会被扔掉的

Presigning post data encountered an error { UnexpectedParameter: ContentLength is not supported in pre-signed URLs.

这个主题有一个issue

关于amazon-web-services - AWS S3 createPresignedPost与getSignedUrl。我应该使用哪一个从客户端上传各种文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52656085/

相关文章:

amazon-web-services - AWS 上的 Godaddy 电子邮件设置

android - 使用 Amazon API Gateway 时出现 SSL 握手中止错误

amazon-web-services - AWS Fargate 私有(private)子网,从 ECR 拉取

php - Laravel 验证文件数组总允许上传大小

java - Apache Commons Fileupload/Tomcat 无法处理 out.flush()

PHP:如何将临时文件上传复制到多个地方?

amazon-web-services - 如何将 AWS Crawler 配置导出为 JSON(或类似格式)并 checkin 源代码管理?

php - 无法使用模式 r : fopen(): AWS Elastic Beanstalk 打开

reactjs - 如何在 AWS S3 对象(CreateReactApp 构建输出)上实现复杂的静态文件缓存?

amazon-web-services - 使用 gitlab CI 通过 CLI 创建 lambda 函数时出错(错误解析参数 '--zip-file' : Unable to load paramfile)