You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to upload file without chaining the middlewares, the file upload works but when I chain it with other middlewares like input validation and authentication the file does not upload and I get req.file/req.files object as undefined.
Kindly help me to find what the issue is as I have been not able to find one yet.
I use postman to test the api and have set the correct body, authorization token and form data but still the error persists.
In case it helps, I encountered similar after adding express-openapi-validator to an endpoint expecting a single file. req.file was undefined but the uploaded file was still referenced in req.files[] as a single entry.
In case it helps, I encountered similar after adding express-openapi-validator to an endpoint expecting a single file. req.file was undefined but the uploaded file was still referenced in req.files[] as a single entry.
When I try to upload file without chaining the middlewares, the file upload works but when I chain it with other middlewares like input validation and authentication the file does not upload and I get req.file/req.files object as undefined.
Kindly help me to find what the issue is as I have been not able to find one yet.
I use postman to test the api and have set the correct body, authorization token and form data but still the error persists.
Github link of the project: https://github.com/imhazard17/user_mvp
Endpoint
Authentication middleware
Input validation middleware
The text was updated successfully, but these errors were encountered: