Expressjs Multer File Upload
Expressjs + Multer for file upload.
Usages:
multer({ limits, fileFilter, storage })
creates Multer object for reusable in different requset handlers.
limits
limit fileSize, fieldName, etc…fileFilter
custom file validationstorage
disk / memory / custom storage transform ([s3)
multer().array('photos', 2)
creates request handler for different routes.
single
one file upload, get byreq.file
array
multiple files upload, get byreq.files
fields
multiple field for files upload, get byreq.files[<fieldName>][0]