title: How to upload images to s3 presigned URL in flutter?
body: <p>I create a s3 presigned URL in typescript as below:</p>
  
  <pre><code>const params = {
        Bucket: myBucketName,
        Key: uuidv4(),
        Expires: 3600,
      };
  s3.getSignedUrlPromise('putObject', params)
  </code></pre>
  
  <p>and I used below code in flutter to upload image to this url:</p>
  
  <p>Option1:</p>
  
  <pre><code>var formData = FormData.fromMap({
        "file":
            await MultipartFile.fromFile(image.path, filename: "upload.png"),
      });
      var response = await Dio().put(url, data: formData);
  </code></pre>
  
  <p>Option2:</p>
  
  <pre><code>return Dio().put(
        url,
        data: image.openRead(),
        options: Options(
          contentType: "multiple/form-data",
          headers: {
            "Content-Length": image].lengthSync(),
          },
        ),
        onSendProgress: (int sentBytes, int totalBytes) {
          double progressPercent = sentBytes / totalBytes * 100;
          print("upload $progressPercent %");
        },
      )
  </code></pre>
  
  <p>in both cases I got <code>403</code> forbidden error response. How can I upload images to the presigned URL? Is there anything wrong in the generated side or flutter side?</p>
  
  <p>I can upload the file with <code>curl</code> command like below:</p>
  
  <pre><code> curl -XPOST -H "Content-Type: application/x-www-form-urlencoded"  --data-binary "@/Users/Pictures/IMG_4634.jpg" $PRESIGNED_URL
  </code></pre>
  
  <p>so the url does work.</p>