diff --git a/plugins/storage/server/api/files.ts b/plugins/storage/server/api/files.ts index a5c9e2b84..2ab8d3aa6 100644 --- a/plugins/storage/server/api/files.ts +++ b/plugins/storage/server/api/files.ts @@ -30,7 +30,12 @@ router.post( rateLimiter(RateLimiterStrategy.TenPerMinute), auth(), validate(T.FilesCreateSchema), - multipart({ maximumFileSize: env.FILE_STORAGE_UPLOAD_MAX_SIZE }), + multipart({ + maximumFileSize: Math.max( + env.FILE_STORAGE_UPLOAD_MAX_SIZE, + env.MAXIMUM_IMPORT_SIZE + ), + }), async (ctx: APIContext) => { const actor = ctx.state.auth.user; const { key } = ctx.input.body; diff --git a/server/routes/api/index.ts b/server/routes/api/index.ts index fc742d02a..52a622909 100644 --- a/server/routes/api/index.ts +++ b/server/routes/api/index.ts @@ -44,7 +44,10 @@ api.use( bodyParser({ multipart: true, formidable: { - maxFileSize: env.FILE_STORAGE_UPLOAD_MAX_SIZE, + maxFileSize: Math.max( + env.FILE_STORAGE_UPLOAD_MAX_SIZE, + env.MAXIMUM_IMPORT_SIZE + ), maxFieldsSize: 10 * 1024 * 1024, }, })