anacronw / multer-s3

multer storage engine for amazon s3
MIT License
660 stars 190 forks source link

Validation Error: Array of Files Validate in Multer #165

Closed MohsinNawazBaig closed 2 years ago

MohsinNawazBaig commented 2 years ago

Hi, Today I am testing my application and I faced a multer-s3 error. I have allowed only Image mime-type files. Suppose I upload 4 files and the first 3 files is image mime-type and but the last one is a pdf file. Multer is doing a process file one by one and while in the last file he gave me an error. But the issue is that multer firstly uploaded 3 files on the server and when mime-type occur in the last file then he deleted the files on s3. He took also a little bit of time because I uploaded small files but if the first 3 files sizes are 20MB

Thanks

LinusU commented 2 years ago

This is unfortunately a limitation of the current API design. If you need to work around this I would suggest using Multer 2.x which caches all files locally before handing them off to the route handler...