From 556cdf722e14dc09f9b2aff9ade18a0213d4ec0c Mon Sep 17 00:00:00 2001 From: wuwei Date: Thu, 27 Jun 2024 20:29:42 +0800 Subject: [PATCH] fix: update --- src/server/upload/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/upload/index.js b/src/server/upload/index.js index 114c5b8..91ddcba 100644 --- a/src/server/upload/index.js +++ b/src/server/upload/index.js @@ -2,6 +2,7 @@ import express from "express"; import multiparty from "multiparty"; const router = express.Router(); +const uploadDir = "./src/server/static"; /** * Uploads a file using the multiparty library. * @@ -12,8 +13,8 @@ const multipartyUpload = (req) => { return new Promise(async (resolve, reject) => { const form = new multiparty.Form({ maxFilesSize: 1024 * 1024 * 1024, + uploadDir, }); - form.uploadDir = "./src/server/static"; form.parse(req, (err, fields, files) => { if (err) { reject(err);