title: how to set name of file being uploaded in connect-multiparty?
body: <p>I have have one page where I want to accept one file and 3-4 user inputs , I was able to achieve this using <code>connect-multiparty middle-ware</code> but the name of uploaded file is something gibberish with correct extension and uploaded files contents are too correct.</p>
  
  <p>I want to achieve below things</p>
  
  <blockquote>
    <ol>
    <li>Set name of file being uploaded</li>
    <li>Create copy of file with different name if the file with same name exists in target directory</li>
    <li>Set max limit on size and restrict type of file.</li>
    </ol>
  </blockquote>
  
  <p>I searched on net but could not find any working example. My complete code is as below </p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var fs = require('fs');
  var multiparty = require('connect-multiparty');
  var multipartyMiddleware = multiparty({
      uploadDir : '../public/uploads'
  });
  
  router.post('/api/user/uploads', multipartyMiddleware, function(req, res) {
  
      var file = req.files.file;
      console.log(file.name);
      console.log(file.type);
      console.log(file);
      console.log(req.body.test);
  
      console.log("The file was saved!");
      res.json({
          success : 1
      });
      return;
  
  });
  
  module.exports = router;
  </code></pre>