title: File upload with postman with pre-signed url not working
body: <p>I am trying to upload a file using postman. I have attached the file by clicking "body" (in postman) -> binary -> choose file. I use S3 to upload with pre-signed urls. In the url, the name of the file is exactly the same as the name of the file I select in postman. When running the request, I get an error:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Error&gt;
      &lt;Code&gt;SignatureDoesNotMatch&lt;/Code&gt;
      &lt;Message&gt;The request signature we calculated does not match the signature you provided. Check your key and signing method.&lt;/Message&gt;
      &lt;AWSAccessKeyId&gt;...&lt;/AWSAccessKeyId&gt;
      &lt;StringToSign&gt;PUT
  
  text/plain
  1551977056
  x-amz-acl:private
  /wiivv-staging-private-storage/measurement/6506684788010901504/1551405460831/topLeft-2.jpeg&lt;/StringToSign&gt;
      &lt;SignatureProvided&gt;...&lt;/SignatureProvided&gt;
      &lt;StringToSignBytes&gt;...&lt;/StringToSignBytes&gt;
      &lt;RequestId&gt;DB2FC5FE064CF49A&lt;/RequestId&gt;
      &lt;HostId&gt;zbsLj7mcuXJa8D9JX1jFN1Lo+lI02/EvJreAXmPQjPezmU1sucQamXuqlGoUBzAq3nAaejx3doA=&lt;/HostId&gt;
  &lt;/Error&gt;
  </code></pre>
  
  <p>However by exporting the postman request (by clicking on "code") to get a curl command I get:</p>
  
  <pre><code>curl -X PUT \
    '[s3-presigned-url]' \
    -H 'Postman-Token: 84700b0d-0cd2-4de5-b52c-7de39a12253e' \
    -H 'cache-control: no-cache'
  </code></pre>
  
  <p>And adding an additional option for uploading the file:</p>
  
  <pre><code>curl -X PUT \
    '[s3-presigned-url]' \
    -H 'Postman-Token: 84700b0d-0cd2-4de5-b52c-7de39a12253e' \
    -H 'cache-control: no-cache'
    --upload-file ~/topLeft-2.jpeg
  </code></pre>
  
  <p>it worked!</p>
  
  <p>In summary, in postman, it doesn't work and the same request exported in curl with the addition of the <code>--upload-file</code> option, it does...</p>
  
  <p>How can I make the request work with postman?</p>
  
  <p>EDIT 1:
  Looks like it is related to the bug <a href="https://github.com/postmanlabs/postman-app-support/issues/2521" rel="nofollow noreferrer">https://github.com/postmanlabs/postman-app-support/issues/2521</a> where postman automatically add a <code>Content-Type: text/plain</code> header even though no headers were provided.</p>
  
  <p>EDIT 2:
  here a screen shot of the postman console. See the unwanted <code>content-type</code> header?
  <a href="https://i.stack.imgur.com/18OiO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/18OiO.png" alt="enter image description here"></a>
  But you can't see that header if you toggle the <code>Pretty</code> output:
  <a href="https://i.stack.imgur.com/uVKMz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uVKMz.png" alt="enter image description here"></a></p>
  
  <p>EDIT 3:
  using "content-type: multipart/form-data", I get</p>
  
  <pre><code>PUT /measurement/6506684788010901504/1551405460831/topLeft-2.jpeg?AWSAccessKeyId=AKIAIKNR3HJGZI24MDTQ&amp;Expires=1554393626&amp;Signature=OaqaUqB2%2B3jp2AH97aWKujV3ZD8%3D&amp;x-amz-acl=private
  Content-Type: multipart/form-data; boundary=--------------------------092560820091438222667657
  cache-control: no-cache
  Postman-Token: e45247b4-0fc4-4adb-8e7b-effb82dc8e73
  User-Agent: PostmanRuntime/7.6.1
  Accept: */*
  Host: wiivv-staging-private-storage.s3.amazonaws.com
  accept-encoding: gzip, deflate
  content-length: 199703
  
  name=topLeft-2.jpegfilename=[object Object]
  
  HTTP/1.1 403
  status: 403
  x-amz-request-id: 640967A618ABD4A0
  x-amz-id-2: IVZtpEDxEEo0R7JaQWrsOi8/6UESbKH4dZNWDnwJDJBhv1ppZx56cvMPt6xT4ZJ3qWiFernsu54=
  Content-Type: application/xml
  Transfer-Encoding: chunked
  Date: Thu, 04 Apr 2019 15:58:34 GMT
  Connection: close
  Server: AmazonS3
  &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Error&gt;&lt;Code&gt;SignatureDoesNotMatch&lt;/Code&gt;&lt;Message&gt;The request signature we calculated does not match the signature you provided. Check your key and signing method.&lt;/Message&gt;&lt;AWSAccessKeyId&gt;AKIAIKNR3HJGZI24MDTQ&lt;/AWSAccessKeyId&gt;&lt;StringToSign&gt;PUT multipart/form-data; boundary=--------------------------092560820091438222667657 1554393626 x-amz-acl:private /wiivv-staging-private-storage/measurement/6506684788010901504/1551405460831/topLeft-2.jpeg&lt;/StringToSign&gt;&lt;SignatureProvided&gt;OaqaUqB2+3jp2AH97aWKujV3ZD8=&lt;/SignatureProvided&gt;&lt;StringToSignBytes&gt;50 55 54 0a 0a 6d 75 6c 74 69 70 61 72 74 2f 66 6f 72 6d 2d 64 61 74 61 3b 20 62 6f 75 6e 64 61 72 79 3d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 30 39 32 35 36 30 38 32 30 30 39 31 34 33 38 32 32 32 36 36 37 36 35 37 0a 31 35 35 34 33 39 33 36 32 36 0a 78 2d 61 6d 7a 2d 61 63 6c 3a 70 72 69 76 61 74 65 0a 2f 77 69 69 76 76 2d 73 74 61 67 69 6e 67 2d 70 72 69 76 61 74 65 2d 73 74 6f 72 61 67 65 2f 6d 65 61 73 75 72 65 6d 65 6e 74 2f 36 35 30 36 36 38 34 37 38 38 30 31 30 39 30 31 35 30 34 2f 31 35 35 31 34 30 35 34 36 30 38 33 31 2f 74 6f 70 4c 65 66 74 2d 32 2e 6a 70 65 67&lt;/StringToSignBytes&gt;&lt;RequestId&gt;640967A618ABD4A0&lt;/RequestId&gt;&lt;HostId&gt;IVZtpEDxEEo0R7JaQWrsOi8/6UESbKH4dZNWDnwJDJBhv1ppZx56cvMPt6xT4ZJ3qWiFernsu54=&lt;/HostId&gt;&lt;/Error&gt;
  </code></pre>