0

Have been trying to upload files from different fields but the same form using multer but they are not displaying in front end that's my index page and the upload directory.

But anytime I upload.single() everything is working fine and even upload.array() is still not working.

nik7
  • 806
  • 3
  • 12
  • 20
Gabriel
  • 35
  • 1
  • 8

2 Answers2

0

instead of upload.array() use upload.any()

James_kahosh
  • 65
  • 1
  • 1
  • 5
0

I was missing the enctype="multipart/form-data" attribute in the HTML form where I was using the file input element.

For more info check: What does enctype='multipart/form-data' mean?

Nico Serrano
  • 577
  • 4
  • 14