Node.js uploads pictures locally, but the server reports an error.



tmp


mac centOS

Mar.02,2021

path does not exist, just create it. If you can add path judgment in front of the code, there is no mkdir.


create a tmp directory under the corresponding static folder on the server.


problem solved.
the path setting on the local machine is form.uploadDir ='. / tmp';
but cannot be recognized on the centOS server. If the point is removed, the path can be found form.uploadDir ='/ tmp'; in the server root path,

.

but how to set it to the root path of the project form.uploadDir ='/ www/wwwroot/tmp'; I feel silly to set it this way. I hope God will give me some advice

Menu