title: Saving Images to S3 from External URL with Node.js and MongoDB
body: <p>I'm trying to save the images from a third-party API to my own S3 bucket using Node.js and MongoDB. The API provides a URL to the image on the third-party servers. I've never done this before but I'm assuming I have to download the image to my own server and then upload it to S3?</p>
  
  <p>Should I save the image to mongodb with GridFS and then delete it once it is on S3? If so, what's the best way to do that?</p>
  
  <p>I've read and re-read this previous question:</p>
  
  <p><a href="https://stackoverflow.com/questions/6936396/problem-with-mongodb-gridfs-saving-files-with-node-js">Problem with MongoDB GridFS Saving Files with Node.JS</a></p>
  
  <p>But I can't find good documentation on how I should determine buffer/chunk size and other attributes for a JPEG image file.</p>
  
  <p>Once I've saved the file on my server/database, then it seems like I should use:</p>
  
  <p><a href="https://github.com/appsattic/node-awssum" rel="nofollow noreferrer">https://github.com/appsattic/node-awssum</a></p>
  
  <p>To upload it to S3. Is that a good idea?</p>
  
  <p>I apologize if this is an obvious answer, I'm pretty green when it comes to databases and server scripting.</p>