title: How can I upload the image to AWS S3
body: <p><a href="https://i.stack.imgur.com/nZBxb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nZBxb.png" alt="How to access that key name &lt;code&gt;pin_img&lt;/code&gt; in my post API"></a></p>
  
  <h2>pin.js</h2>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function uploadPinMedia(req, res, next) {
  
      var s3 = new AWS.S3({
          accessKeyId: 'AKIAIUCBE3TQGL6ATPBA',
          secretAccessKey: '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',
          Bucket: 'mapery-v2'
      });
  
      var data = {
          Bucket: 'mapery-v2',
          Key: 'upload-v2',
          Body: req.files.pin_img
      };
  
      s3.putObject(data, function(err, media_res) {
          if(err) 
              console.log('error uploading data', media_res);
          console.log(media_res);
      });
      
  }</code></pre>
  </div>
  </div>
  
  I am trying to upload an image to s3 bucket from postman, but it seems to be the form data <code>req.files.pin_img</code> I am passing is not correct. Am I wrong anywhere ??</p>