发布图像S3冲突的查询字符串参数字符串、图像、冲突、参数

2023-09-12 21:27:20 作者:陪你从学堂到殿堂

我想张贴到S3,但找回了这样一个错误:

I'm trying to post to s3, but get back an error of this:

<Error>
  <Code>InvalidArgument</Code>
  <Message>Conflicting query string parameters: acl, policy</Message>   
  <ArgumentValue>acl</ArgumentValue>
  <ArgumentName>ResourceType</ArgumentName>
  <RequestId>AD52BCA534..</RequestId>  
  <HostId>gdICZHAf...</HostId>
</Error>

什么是相互冲突的查询字符串参数是什么意思?

What does conflicting query string parameters mean?

推荐答案

如果您使用的是HTML表单上传的文件,请确保您有窗体的加密类型集以的multipart / form-data的。我被包括属性之前收到完全相同的错误。

If you are using an HTML form to upload the file, make sure you have the form's enctype set to multipart/form-data. I was receiving the exact same error before including that attribute.

例如。

<form action="https://mybucket.s3.amazonaws.com/" 
   method="POST" 
   enctype="multipart/form-data">