title: Create file based on buffer data in nodejs
body: <p>I am sending from front end client side a file, on the server side I have something like this:</p>
  
  <pre><code>{ name: 'CV-FILIPECOSTA.pdf',
    data: &lt;Buffer 25 50 44 46 2d 31 2e 35 0d 25 e2 e3 cf d3 0d 0a 31 20 30 20 6f 62 6a 0d 3c 3c 2f 4d 65 74 61 64 61 74 61 20 32 20 30 20 52 2f 4f 43 50 72 6f 70 65 72 ... &gt;,
    encoding: '7bit',
    mimetype: 'application/pdf',
    mv: [Function: mv] }
  </code></pre>
  
  <p>What I need is to create the file may be based on that buffer that is there, how can I do it? </p>
  
  <p>I already searched a lot and didn't find any solution.</p>
  
  <p>This is what I tried so far:</p>
  
  <pre><code>router.post('/upload', function(req, res, next) {
    if(!req.files) {
      return res.status(400).send("No Files were uploaded");
    }
    var curriculum = req.files.curriculum; 
    console.log(curriculum);
    curriculum.mv('../files/' + curriculum.name, function(err) {
      if (err){
        return res.status(500).send(err);      
      }
      res.send('File uploaded!');
    });
  });
  </code></pre>