multer
multer copied to clipboard
Request body is null after upgrade from 1.4.4 to 1.4.5-lts.1
my request like this:
` POST http://localhost:8000/cos/uploadOneFile Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary Content-Disposition: form-data; name="param1"; Content-Type: text/plain
abc --WebAppBoundary Content-Disposition: form-data; name="upload"; filename="event/test1.jpg" Content-Type: image/jpeg
< /root/test-00-04-49-489.jpg `
and I cannot get param1 from request body, and my code like this
router.post('/uploadOneFile', upload.single('upload'), (request, response) => { let { param1 } = request.body; }
Hm, this seems to be because of a newer version of Busboy. Would you be able to reproduce your bug with that and file an issue in their repo?
hi @Alangus , i just noticed the same problem. somehow the trailing semicolon is not allowed anymore. not sure if this could or should be fixed in busyboy, multer, or in your client.
Content-Disposition: form-data; name="param1";
I have the same problem. Updated my Multer to 1.4.5-lts.1
and now every single request has an undefined
request.file
.
This is my Postman request (my Content-Type is multipart/form-data):
This is my Postman console:
My code and my results:
Edit: hmmmmm I downgraded to 1.4.4
but I still have the same problem even that it was working before... Maybe there is something else. I also updated my mongoose
to 6.6.1
from 6.5.2
in my last commit.
Edit 2: I tried to rollback everything I made in my API last week but I still get the same problem ):
Sorry for the multiple edition and comment about this issue. My situation was about Multer not finding the right folder to upload my photo. 😅 Creating the folder in the right directory made it work again.
I'm not sure if this is mentioned on docs but it might be a good first issue!
We are also experiencing the same problem, moving to 1.4.5-lts.1 causes the files array to be empty. This is definitely due to the fact that the content-disposition line has a trailing semi-colon, which busboy no longer supports. Unfortunately we're receiving data from a source we do not control, so no option to change that. I can't seem to find why this is now the case, busboy went through a significant rewrite....