nodejs formidable changing uploadDir nodejs formidable changing uploadDir express express

nodejs formidable changing uploadDir


The IncomingForm constructor takes an options object. You'll probably need to use the __dirname global in your path as well.

var form = new formidable.IncomingForm({ uploadDir: __dirname + '/uploaded' });

You can see how the option is applied in the formidable source.


You can keep the renaming code when 'end' is triggered so that it renames after the file is completely uploaded.