title: Node.js upload file into Buffer instead of /tmp
body: <p>In a Node.js app, is it possible to upload a file (<code>multipart/form-data</code>) directly into a buffer on the server instead of saving the file to the filesystem?</p>
  
  <p>In psuedo code you typically do this with a file upload form</p>
  
  <pre><code>router.post('/upload', function(req, res, next){
    // file is saved to /tmp/dk3idkalel4kidkek
    // do some processing on the file
    // manually save file to /www/myapp/uploads/originafilename.ext
  });
  </code></pre>
  
  <p>Is it possible to skip the part about saving the file to <code>/tmp</code> and just capturing the uploaded file as a Buffer and streaming it directly to the destination directory?</p>
  
  <p>An example would be uploading an image, then optimizing the image, then saving it to it's intended destination. Can you just capture the incoming stream, optimize it then save it, all without the initial saving to the <code>/tmp</code> directory?</p>