Upload files to Node.js using multer

Asked

Viewed 35 times

-2

I’m using multer to upload files to my backend. However, I am in a situation where I need to upload several files along with other data to a form, however each file may contain an associated description. My problem is that I can’t get multer to load more than one file type input, which prevents me from adding the description to every file in the form. Is it possible? Recommend some other upload library for this situation?

  • This has the attribute .fields which accepts multiple files. I suggest taking a look at other answers here at Sopt.

  • You don’t answer for the following... I can upload several files as it is being done, but that way I could not make the association of each file with its description. I believe this would be possible if multer accepted files from various input file fields on the front. However, with only one field that receives several files I lose the association

  • but the .fields don’t do it? take a look at the official documentation.

  • That last reply was in reference to the other community post you suggested. I didn’t know the . Fields so far, including thank you, only remembered the single and the array. I will study about it in the documentation, if possible could leave an example for me to mark as response?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.