title: Node Multer unexpected field
body: <p>I'm working on uploading a file to my app using the multer npm module.</p>
  
  <p>The multer function I have defined is to allow a single file uploaded to the file system.  Everything works during run time; the issue is after I upload the file I get an error below.  Any advice appreciated on where to look.</p>
  
  <h1>Error:</h1>
  
  <pre><code>Unexpected field
  
  Error: Unexpected field
      at makeError (c:\Users\Dev\WebstormProjects\Crunch\node_modules\multer\lib\make-error.js:12:13)
      at wrappedFileFilter (c:\Users\Dev\WebstormProjects\Crunch\node_modules\multer\index.js:39:19)
      at Busboy.&lt;anonymous&gt; (c:\Users\Dev\WebstormProjects\Crunch\node_modules\multer\lib\make-middleware.js:97:7)
      at Busboy.emit (events.js:118:17)
      at Busboy.emit (c:\Users\Dev\WebstormProjects\Crunch\node_modules\multer\node_modules\busboy\lib\main.js:31:35)
      at PartStream.&lt;anonymous&gt; (c:\Users\Dev\WebstormProjects\Crunch\node_modules\multer\node_modules\busboy\lib\types\multipart.js:205:13)
      at PartStream.emit (events.js:107:17)
      at HeaderParser.&lt;anonymous&gt; (c:\Users\Dev\WebstormProjects\Crunch\node_modules\multer\node_modules\busboy\node_modules\dicer\lib\Dicer.js:51:16)
      at HeaderParser.emit (events.js:107:17)
      at HeaderParser._finish (c:\Users\Dev\WebstormProjects\Crunch\node_modules\multer\node_modules\busboy\node_modules\dicer\lib\HeaderParser.js:70:8) 
  </code></pre>
  
  <h1>app.js</h1>
  
  <pre><code>var multer = require('multer');
  var app = express();
  var fs = require('fs');
  
  //. . . 
  
  var upload = multer({ dest: 'upload/'});
  var type = upload.single('file');
  
  app.post('/upload', type, function (req,res) {
    var tmp_path = req.files.recfile.path;
    var target_path = 'uploads/' + req.files.recfile.name;
  fs.readFile(tmp_path, function(err, data)
  {
    fs.writeFile(target_path, data, function (err)
    {
      res.render('complete');
    })
  });
  </code></pre>
  
  <h1>Index.hbs</h1>
  
  <pre><code>&lt;form action="/upload" method="post" enctype="multipart/form-data"&gt;
      &lt;input type="file" name='recfile' placeholder="Select file"/&gt;
      &lt;br/&gt;
      &lt;button&gt;Upload&lt;/button&gt;
  &lt;/form&gt;
  
  #Package.json
    "dependencies": {
      "body-parser": "~1.13.2",
      "cookie-parser": "~1.3.5",
      "debug": "~2.2.0",
      "easy-zip": "0.0.4",
      "express": "~4.13.1",
      "hbs": "~3.1.0",
      "less-middleware": "1.0.x",
      "morgan": "~1.6.1",
      "multer": "~1.0.0",
      "serve-favicon": "~2.3.0"
    }
  }
  </code></pre>