mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00
refactor: use fileSize limiternative to multer (#1209)
This commit is contained in:
parent
5e6f8cbce7
commit
55cdd2eec6
1 changed files with 1 additions and 5 deletions
|
@ -29,13 +29,9 @@ const fileFilter = (req, file, cb) => {
|
|||
);
|
||||
}
|
||||
|
||||
if (file.size > sizeLimit) {
|
||||
return cb(new Error(`File size exceeds ${sizeLimit / 1024 / 1024} MB.`), false);
|
||||
}
|
||||
|
||||
cb(null, true);
|
||||
};
|
||||
|
||||
const upload = multer({ storage, fileFilter });
|
||||
const upload = multer({ storage, fileFilter, limits: { fileSize: sizeLimit } });
|
||||
|
||||
module.exports = upload;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue