File encoding.
File extension.
Mime type (based on the file extension).
Name of the file that was persisted on a disk.
Name of the file that was received in the form-data request.
Full path to the persisted file.
Whitelisted mime types. (All if undefined)
Default: all
A destination where files will be saved on a disk.
Default: ./
The result of this function will work as a new file name persisted on a disk.
Default: random hex string
Max size of a field name in bytes.
Default: 100 (100 B)
Max size of a field in bytes.
Default: 1048576 (1 MB)
Max size of a single file in bytes.
Default: 8388608 (8 MB)
This function will be executed if magic bytes verification couldn't be successfully performed. See verifyMagic for more information.
If the function returns false, then the file will be rejected, otherwise Content-Type will be used.
If true, extensions will be preserved in the file name.
Default: false
Warning: Preserving extensions can possibly be dangerous for security reasons, should always be used with verifyMagic set to true.
If true, magic bytes will be verified to check if the binary data of the file is correct.
Default: false
Content-Type, then onInvalidMagic will be ran.Constructor for the Multipart
import multipart from "express-multipart";
const mp = multipart();
Global multipart options that will be applied for all multipart requests.
New Multipart instance with specified option parameters (if there are any).
Constructor for the Multipart
import multipart from "express-multipart";
const mp = multipart();
Global multipart options that will be applied for all multipart requests.
New Multipart instance with specified option parameters (if there are any).
Generated using TypeDoc
Path to the storage directory.