Monday, 18 November 2019

How to seperate files with Multer using upload.fields() in Node?

Sorry if this is a beginner question, I can not find any proper documentation / examples of this.Basically I have a form with 2 seperate file uploads. One to upload multiple images, and one to upload a CSV file containing information about said images. It looks like this:EJS:

upload files





Node: router.post( "/UploadFiles", upload.fields([{name: 'UploadFile',maxCount: 50},{name: 'UploadCsv', maxCount: 1}]), (req, res, next) Now I am wondering, how can I best seperate the 2 files which are being uploaded? With 1 file input I would usually do let foo = req.files;

Submitted November 18, 2019 at 01:42PM by html_question_guy

No comments:

Post a Comment