Reputation: 1320
I want to make file upload using nodejs, but fs.rename() cannot move a file between two different disks/partitions, I don't want to copy uploaded file from temporary directory. I want to change temporary directory so fs.rename() will work.
how can i do that? thanks!
Upvotes: 3
Views: 3846
Reputation: 224922
The module responsible for that is formidable, and you can set uploadDir
, as per the README:
form.uploadDir = "/my/dir";
Sets the directory for placing file uploads in. You can move them later on using
fs.rename()
. The default isos.tmpDir()
.
Upvotes: 3