title: How to upload a large file (> 1GB) directly to Amazon S3 from a given URL using NodeJS without actually saving the file in local?
body: <p>I tried uploading a large file to S3 in many ways in NodeJS using <strong><em>aws-sdk</em></strong> but eventually ended up just uploading only 1mb of a file which is actually 1.2 GB. </p>
  
  <p>So, I tried using  streaming-s3   in node js, the code is shown below.</p>
  
  <p>I referred  <a href="https://www.npmjs.com/package/streaming-s3" rel="nofollow noreferrer">https://www.npmjs.com/package/streaming-s3</a>  for streaming-s3 package.</p>
  
  <pre><code>var streamingS3 = require('streaming-s3');
  var request = require('request');
  var url = 'XXXXXXXXX';
  var rStream = request.get(url);
  
  var uploader = new streamingS3(
    rStream,
    {accessKeyId: 'XXXXXXXXXXXXX',
      secretAccessKey: 'XXXXXXXXX'
    }, 
   {
      Bucket: 'XXXXXXXXX',
      Key: 'XXXXXXX',
      ContentType: 'text/html'
    },
  
    {
      concurrentParts: 2,
      waitTime: 10000,
      retries: 1,
      maxPartSize: 10 * 1024 * 1024
    }
  );
  
  uploader.begin();
  </code></pre>
  
  <p>When I run this code, the chunks from the file are not actually getting uploaded to S3 in streams.
  Only 1mb is getting uploaded, but not the entire file. 
  Is there any other way to upload a file to S3 from a URL ?</p>