Im trying to use Multer to upload an array of images. At the client side i have a FormData called pictures.
Step 1 – Create formData with all images:
const data = new FormData(); pictures.forEach(pic => { data.append('pictures', { fileName: pic.fileName, uri: pic.image, type: pic.type, }); }); const headers = { 'Content-Type': 'multipart/form-data', 'x-access-token': token, }; const diaryUpdatePost = await post(`diary/uploadPictures/{file.fieldname}-
{req.files}...`); };
I already tried to use express-fileupload, but req.files return undefined. Some ideia to help? Thx.
Anonymous Asked question May 14, 2021
Recent Comments