NodeJS fs module will basically execute a rename operation on fs.rename, which will fail if the origin and destiny paths are on different partitions.
This happened to me while testing in my Windows environment: my code is under the D:\ partition, while my temporary directory (which is treated as the server's tmp directory) was under C:\.
Consider a fallback to copying and deleting the file for these cases.
Visible symptom
Run the code from partition D:, have your user's temporal directory in partition C:
Try to upload an image
The server will return an error like the following (with status 200)
NodeJS
fs
module will basically execute arename
operation onfs.rename
, which will fail if the origin and destiny paths are on different partitions.This happened to me while testing in my Windows environment: my code is under the
D:\
partition, while my temporary directory (which is treated as the server's tmp directory) was underC:\
.Consider a fallback to copying and deleting the file for these cases.
Visible symptom
References