title: Upload file from external url to S3
body: <p>I'm trying to upload an image to S3 from an external url.</p>
  <p>Currently, I can successfully upload a file, but after I download and open it I see that it is corrupted.</p>
  <p>Here is the code I'm using (got is just what I use to fetch the resource):</p>
  <pre><code>const got = require('got');
  const Web3 = require('web3');
  
  const s3 = new AWS.S3({
      accessKeyId: AWS_ACCESS_KEY_ID,
      secretAccessKey: AWS_SECRET_ACCESS_KEY,
  });
  
  const response = await got('https://example.com/image.jpg');
  
  const uploadedFile = await s3
      .upload({
          Bucket: 'my_bucket',
          Key: 'images/',
          Body: response.body,
          ContentType: 'image/jpeg',
      })
      .promise();
  </code></pre>
  <p>I tried to create a buffer, and use putObject instead of upload, but I end up with with files that are only a few bytes on S3 instead.</p>