title: How to change upload path when use formidable with express in node.js
body: <p>Actually I come across two problem</p>
  
  <p><strong>First, how to change the upload path</strong></p>
  
  <p>my folder structure is like this:</p>
  
  <pre><code>|__app.js
  |__upload
  </code></pre>
  
  <p>my node code is in app.js and boot from it, 
  so I want to the upload image upload to the upload folder, I change the path:</p>
  
  <pre><code>var form = new formidable.IncomingForm;
  form.uploadDir = "./upload";
  </code></pre>
  
  <p>It seems it upload successed, but I don't know where the file go, 
  it doesn't in the upload folder.</p>
  
  <p>So what the correct path name?</p>
  
  <p><strong>The second problem is</strong></p>
  
  <p>If I don't change it, it could upload correctly to the <code>C:/Users/ADMINI~1/AppData/Local/Temp</code>
  but it will be renamed without the foramt, </p>
  
  <p>so how can I get the upload format and renamed by myself?</p>
  
  <p><strong>The third problem is</strong> </p>
  
  <p>I also bind handler to the <code>process</code> event,
  like</p>
  
  <pre><code>form.on('progress', function(bytesReceived, bytesExpected) {
      console.log(bytesReceived + ' ' + bytesExpected);
  });
  </code></pre>
  
  <p>but it seems doesn't work,when upload log nothing. why?Do I missing something?</p>
  
  <p>Here is my all code:</p>
  
  <pre><code>app.post('/upload', function (req, res) {
      var form = new formidable.IncomingForm;
      // form.uploadDir = "./upload";
      console.log(form.uploadDir);
  
      form.parse(req, function(err, fields, files){
        if (err) return res.end('You found error');
        console.log(files.image);
      });
  
      form.on('progress', function(bytesReceived, bytesExpected) {
          console.log(bytesReceived + ' ' + bytesExpected);
      });
  
      form.on('error', function(err) {
          res.writeHead(200, {'content-type': 'text/plain'});
          res.end('error:\n\n'+util.inspect(err));
      });
  
      // res.end('Done');
      res.send("well done");
  
      return;
  })
  </code></pre>