title: AWS S3: MaxPostPreDataLengthExceeded Your POST request fields preceeding the upload file was too large
body: <p>I am trying to upload a file to AWS S3, using AWS Javascript SDK's createPresignedPost method,<br>
  <strong>I have the following code to generate the signed credentials for upload -</strong></p>
  
  <pre><code>let AWS = require('aws-sdk');
  let util = require('util');
  
  let s3Client = new AWS.S3({
      region: 'us-east-1'
  });
  
  let postSignedUrl = async () =&gt; {
  
      try {
          let postSigningParams = {
              Expires: 60,
              Bucket: "some-bucket-name,
              Conditions: [["content-length-range", 100, 10000000]],
              Fields: {
                  key: 'test/image.jpg'
              }
          }
  
          let s3createPresignedPost = util.promisify(s3Client.createPresignedPost).bind(s3Client);
          let postSignedUrl = await s3createPresignedPost(postSigningParams);
  
          console.log('postSigningParams =&gt; ', postSignedUrl);
      } catch (error) {
          console.error(error);
      }
  }
  
  postSignedUrl();
  </code></pre>
  
  <p><strong>I receive credentials like below -</strong></p>
  
  <pre><code>{
              "url": "https://s3.amazonaws.com/some-bucket-name",
              "fields": {
                  "key": "test/image.jpg",
                  "bucket": "some-bucket-name",
                  "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
                  "X-Amz-Credential": "some/credentials/us-east-1/s3/aws4_request",
                  "X-Amz-Date": "20191118T020945Z",
                  "X-Amz-Security-Token": "somesecuritytoken",
                  "Policy": "somepolicy",
                  "X-Amz-Signature": "somesignature"
              }
  }
  </code></pre>
  
  <p><strong>But when I try to upload an image using the above creds using POSTMAN tool,<br>
  I am not able to do so.</strong></p>
  
  <p><a href="https://i.stack.imgur.com/g6mDF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/g6mDF.png" alt="enter image description here"></a></p>
  
  <p>I double-checked my file size, and it's 5 MB,<br>
  while the range that I've set while creating the signed url is between 100 to 10000000 bytes</p>
  
  <p><strong>References -</strong><br>
  <a href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#createPresignedPost-property" rel="noreferrer">https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#createPresignedPost-property</a><br><br>
  <a href="https://blog.bigbinary.com/2018/09/04/uploading-files-directly-to-s3-using-pre-signed-post-request.html" rel="noreferrer">https://blog.bigbinary.com/2018/09/04/uploading-files-directly-to-s3-using-pre-signed-post-request.html</a><br><br>
  <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html" rel="noreferrer">https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html</a></p>