-
Hello everyone.
and here is my applyMiddleware code for applying express middleware (util/applyMiddleware):
and the last part of code is the API route itself (api/upload.js):
the same method works in express but I've no idea why it doesn't work here.
and specify it in upload middleware:
the console.log statements in destination and filename methods of multer diskStorage don't execute at all. any help would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I finally resolved it after hours of hard work and on the edge of disappointment when I went after using this solution for file uploads in Simple Nextjs File Upload — Backend API
Happily everything works fine now! |
Beta Was this translation helpful? Give feedback.
I finally resolved it after hours of hard work and on the edge of disappointment when I went after using this solution for file uploads in Simple Nextjs File Upload — Backend API
the only problem was with next.js's default bodyParser.
so all I had to do was to add the following configuration lines to api/upload.js
Happily everything works fine now!