Closed Trinity6264 closed 10 months ago
Having same problem. Did you got the solution?
Having same problem. Did you got the solution?
Yeah bro, I solved it by using multer...
It more looks like access problem. Folder /var/ can be not available for user running the app. Usually for var folder rights looks like this: drwxr-xr-x 13 root root, so, it is read only for non root.
Closing since it doesn't have enough details and I do not able to reproduce this if user allow to write into a folder.
app.use( "/api/v1/product", fileUpload({ useTempFiles: true, tempFileDir: path.join(__dirname, "/tmp/"), abortOnLimit:true, createParentPath:true, limits: { fieldSize: 50 * 2024 * 1024 }, }) );
Error Response 2022-10-02T23:44:58.121Z 5f07668c-1c7f-47db-b11f-01f871cec353 ERROR Uncaught Exception {"errorType":"Error","errorMessage":"ENOENT: no such file or directory, mkdir '/var/task/tmp'","code":"ENOENT","errno":-2,"syscall":"mkdir","path":"/var/task/tmp","stack":["Error: ENOENT: no such file or directory, mkdir '/var/task/tmp'"," at Object.mkdirSync (fs.js:1014:3)"," at checkAndMakeDir (/var/task/node_modules/express-fileupload/lib/utilities.js:144:38)"," at module.exports (/var/task/node_modules/express-fileupload/lib/tempFileHandler.js:14:3)"," at Multipart.