title: .mp4 file not playable after uploading to S3 bucket
body: <p>My requirement is to get a .mp4 file from a URL and then upload it in S3 bucket. After uploading file should be playable.
  <strong>Problem</strong>: file is not playable after uploaded to s3</p>
  <p>My Code for the node.js lambda is as below</p>
  <p><strong>Get File from url</strong></p>
  <pre><code>const response = await new Promise((resolve, reject) =&gt; {
  //using http get to load the file in memory buffer    
  const req = https.get(url, function(res) {
        res.on('data', chunk =&gt; {
          dataString += chunk;
        });
        
        res.on('end', () =&gt; {
            console.log('On data end');
        let buffer = Buffer.from(dataString);
        //console.log('buffer');
       
          resolve({
              statusCode: 200,
              body: buffer
          });
        });
      });
      
      req.on('error', (e) =&gt; {
        reject({
            statusCode: 500,
            body: 'Something went wrong!'
        });
      });
  });
  </code></pre>
  <p>Loading it to S3 in the same lambda</p>
  <pre><code> //upload file to S3
  if(response.statusCode == 200){
      var s3 = new AWS.S3();
      await s3.upload({
          Bucket: 'testnb-bucket-audio',
          Key: 'test-'+body.timestamp+'.mp4',
          Body:  Buffer.from(response.body),
        }).promise().then((data) =&gt; {
          console.log('file uploaded');
          console.log(JSON.stringify(data));
        })
        .catch((error)=&gt; {
          console.log('Error occurred in uploading file to S3 -- ', error)
        })
  }
  </code></pre>
  <p>when file is downloaded it shows like this in folder</p>
  <p><a href="https://i.stack.imgur.com/kI1Vh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kI1Vh.png" alt="enter image description here" /></a></p>