-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File upload sends undefined request.files #2602
Comments
@ulisesantana Thanks for letting us know about this issue 👍 . Am guessing you must have figured this out by now, this issue is not related to Postman, seems to be most likely, an express middleware issue, related link:- http://stackoverflow.com/questions/23114374/file-uploading-with-express-4-0-req-files-undefined. Closing this, feel free to reopen if that's not the case. |
This seems to be pretty much related to postman rather than express. And this is a working workaround. Need to be reopened |
Got the same issue. Closing tab and reopening it clear the issue out. Looks more POSTMAN related than Multer. This solution http://stackoverflow.com/questions/35851660/multer-req-file-always-undefined/38461398#38461398 |
Hi. Got the same issue and I found solution. NodeJS side : I use https://www.npmjs.com/package/express-fileupload |
I'm reopening this. Can you guys also try this out on or native apps and let me know if you see this there as well? |
@MaximeMaillet this is perfectly normal. Both Multer and express-fileupload only handle multipart data, which must be set in the Content-Type header. @madebysid, for myself, since recent updates, I don't have that issue anymore, in chrome extension Need more testing I think though |
first i think what node version is the problem but not. i have installed this: and i get the same error: TypeError: Cannot read property 'length' of undefined |
@marcoRamonS Where do you see this error? In Postman's DevTools, or the response section? |
I was building an image uploading API in Express. When I tried by form-data body and post method request.files always come undefined. If I try with a plain html form, request.files come with all the data and the API works fine.
Postman Version: 4.9.2
App: Chrome App (Running on Chrome 54.0.2840.100)
OS details: Ubuntu 16.04 x64
Is the Interceptor on and enabled in the app: No
Did you encounter this recently, or has this bug always been there: Recently.
Expected behaviour: request.file come with all the form data.
This is the code I use for uploading images:
Testing API from Postman
Testing API from plain HTML form
The text was updated successfully, but these errors were encountered: