Skip to content

Commit 8e3b6ed

Browse files
jiaxiaxiajiaxiaxia
andauthored
feat: Increase file limits (#46)
- Increase the maximum file size from 36MB to 60MB - Increase the maximum number of pages from 10 to 300 Co-authored-by: jiaxiaxia <jiaxiaxia@jiaxiaxias-MacBook-Pro.local>
1 parent 8eda3cb commit 8e3b6ed

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

projects/client/src/utils/constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export const FILE_STATUS = {
5454
};
5555

5656
export const FILE_LIMIT = {
57-
MAX_SIZE: 36, // MB
58-
MAX_PAGES: 10,
57+
MAX_SIZE: 60, // MB
58+
MAX_PAGES: 300,
5959
COLLECTION_FILES_LIMIT: 30,
6060
};
6161

projects/server/app/app.router.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import Router from '@koa/router';
22
import appController from './app.controller.js';
33
import multer from '@koa/multer';
4+
const MAX_SIZE = 60;
45
const upload = multer({
5-
limits: { fileSize: 36 * 1024 * 1024 },
6+
limits: { fileSize: MAX_SIZE * 1024 * 1024 },
67
}).single('file');
78

89
const prefix = '/api/v1';
@@ -21,7 +22,7 @@ router.post(
2122
if (error.code === 'LIMIT_FILE_SIZE') {
2223
ctx.throw(
2324
400,
24-
`Your file is larger than (36MB) so we can't deal with it.`,
25+
`Your file is larger than (${MAX_SIZE}MB) so we can't deal with it.`,
2526
);
2627
}
2728
ctx.throw(400, error);

0 commit comments

Comments
 (0)