diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/express-utils.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/helpers/express-utils.ts b/server/helpers/express-utils.ts index 08f77966f..82dd4c178 100644 --- a/server/helpers/express-utils.ts +++ b/server/helpers/express-utils.ts | |||
@@ -68,11 +68,11 @@ function badRequest (_req: express.Request, res: express.Response) { | |||
68 | function createReqFiles ( | 68 | function createReqFiles ( |
69 | fieldNames: string[], | 69 | fieldNames: string[], |
70 | mimeTypes: { [id: string]: string | string[] }, | 70 | mimeTypes: { [id: string]: string | string[] }, |
71 | destinations: { [fieldName: string]: string } | 71 | destination = CONFIG.STORAGE.TMP_DIR |
72 | ): RequestHandler { | 72 | ): RequestHandler { |
73 | const storage = diskStorage({ | 73 | const storage = diskStorage({ |
74 | destination: (req, file, cb) => { | 74 | destination: (req, file, cb) => { |
75 | cb(null, destinations[file.fieldname]) | 75 | cb(null, destination) |
76 | }, | 76 | }, |
77 | 77 | ||
78 | filename: (req, file, cb) => { | 78 | filename: (req, file, cb) => { |
@@ -93,12 +93,11 @@ function createReqFiles ( | |||
93 | 93 | ||
94 | function createAnyReqFiles ( | 94 | function createAnyReqFiles ( |
95 | mimeTypes: { [id: string]: string | string[] }, | 95 | mimeTypes: { [id: string]: string | string[] }, |
96 | destinationDirectory: string, | ||
97 | fileFilter: (req: express.Request, file: Express.Multer.File, cb: (err: Error, result: boolean) => void) => void | 96 | fileFilter: (req: express.Request, file: Express.Multer.File, cb: (err: Error, result: boolean) => void) => void |
98 | ): RequestHandler { | 97 | ): RequestHandler { |
99 | const storage = diskStorage({ | 98 | const storage = diskStorage({ |
100 | destination: (req, file, cb) => { | 99 | destination: (req, file, cb) => { |
101 | cb(null, destinationDirectory) | 100 | cb(null, CONFIG.STORAGE.TMP_DIR) |
102 | }, | 101 | }, |
103 | 102 | ||
104 | filename: (req, file, cb) => { | 103 | filename: (req, file, cb) => { |