Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multer uploading array of files fail

Tags:

node.js

multer

I have an array of file objects that is sent to the server. "files[0] = (file object), files[1]= ... " Multer doesn't recognized its field name and "request.files" is empty but "request.body is with the array of files.

like image 448
h. Oo Avatar asked Sep 21 '25 01:09

h. Oo


1 Answers

My problem was I append the array of files to the FD I uploaded as fd.append(files, fileList) and what I should have done is a for loop that append each file object from the array of files to the FD with a field name of files. Thank you all for your answers.

like image 129
h. Oo Avatar answered Sep 22 '25 15:09

h. Oo