multer doesn't save file to disk #2422
Replies: 3 comments
-
|
Hey, I've never used multer so not sure how to help. Have you asked for help from the multer folks? |
Beta Was this translation helpful? Give feedback.
-
|
You created the |
Beta Was this translation helpful? Give feedback.
-
|
I'm running similar code with blitz dev and can confirm there's a problem. But it actually puts the file to /path/to/project/.blitz/build/uploads/avatar-1622456775867.jpg try this and console.log the response in frontend
Bonus: you can simply set destination: './public' then multer saves the file and appends req.file like this
and actual file can be found in /path/to/project/.blitz/build/public/ In plain next-js the code above works as expected (tried with next dev) you just have to upload to ./public or ./public/, I believe. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i want to use multer in my custom api route to handle file uploads. My custom route looks something like this:
when i upload a file i can see the valid output coming from
req.files:i get the file path, but multer doesn't save the file in this directory. The path doesn't exist. I don't know where is my mistake. Any ideas, how can i solve this?
Beta Was this translation helpful? Give feedback.
All reactions