function createReqFiles (
fieldNames: string[],
mimeTypes: { [id: string]: string | string[] },
- destinations: { [fieldName: string]: string }
+ destination = CONFIG.STORAGE.TMP_DIR
): RequestHandler {
const storage = diskStorage({
destination: (req, file, cb) => {
- cb(null, destinations[file.fieldname])
+ cb(null, destination)
},
filename: (req, file, cb) => {
function createAnyReqFiles (
mimeTypes: { [id: string]: string | string[] },
- destinationDirectory: string,
fileFilter: (req: express.Request, file: Express.Multer.File, cb: (err: Error, result: boolean) => void) => void
): RequestHandler {
const storage = diskStorage({
destination: (req, file, cb) => {
- cb(null, destinationDirectory)
+ cb(null, CONFIG.STORAGE.TMP_DIR)
},
filename: (req, file, cb) => {