middleware
- Description:
- Reusable Express.js middleware
- Source:
Classes
Methods
(static) exports.validateUploadedFiles(req, filesObj, options)
- Description:
- Validates uploaded files against expected types and size limits
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
req |
external:ExpressRequest | |
filesObj |
Object | Files object from formidable |
options |
Object | Upload options including expectedFileTypes and maxFileSize |
Type Definitions
FileUploadOptions
- Description:
- Options which can be passed to file upload middleware
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
maxFileSize |
number | Maximum file size allowed by upload |
uploadDir |
string | Directory file upload should be stored |
promisify |
Boolean | If true, middleware will return a promise rather than use the standard callback. Useful when calling middleware outside of an Express middleware stack |
removeZipSource |
Boolean | To be used in conjunction with the unzip option. Whether the original zip file should be removed after unzipping (true by default) |
unzip |
Boolean | Whether any zip files should be unzipped by the handler |
Options which can be passed to file upload middleware
Type:
- Object