title: Uploading file with express-fileupload
body: <p>I am trying to upload a file with express-fileupload and am having no luck getting it to work. I can get the file (in this case an image) to 'upload' in the sense that I can get the console to show an image uploaded with the correct folder. </p>
  
  <p>startup.js</p>
  
  <pre><code>router.get('/upload', function(req, res) {
      res.render('upload');
  });
  
  router.post('/upload', function(req, res) {
      // The name of the input field (i.e. "sampleFile") is used to retrieve the uploaded file 
    let startup_image = req.files.image;
  
    // Use the mv() method to place the file somewhere on your server 
    startup_image.mv('/images' , function(err) {
        if (err) {
            console.log(err);
        }
    });
  });
  </code></pre>
  
  <p>Then my html form is</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form ref='uploadForm' 
        id='uploadForm' 
        action='/upload' 
        method='post' 
        encType="multipart/form-data"&gt;
          &lt;input type="file" name="image" /&gt;
          &lt;input type='submit' value='Upload!' /&gt;
  &lt;/form&gt;
  </code></pre>