add file upload size limit

This commit is contained in:
OxSaitama 2023-10-02 23:46:01 +02:00
parent 65b6311cf0
commit a2b5ddf9a8

View File

@ -24,7 +24,7 @@ const storage = multer.memoryStorage();
rootUrl, rootUrl,
middlwares: [ middlwares: [
cors({ origin: "*" }), cors({ origin: "*" }),
multer({ storage: storage }).single("file"), multer({ storage: storage, limits: { fileSize: 32000000 } }).single("file"), //32 MB maximum
bodyParser.urlencoded({ extended: true }), bodyParser.urlencoded({ extended: true }),
bodyParser.json(), bodyParser.json(),
], ],