Add MAX_UPLOAD_SIZE environment variable

This commit is contained in:
Rudy ERCEK
2025-11-12 02:00:06 +01:00
committed by yu-i-i
parent 56e0a12a8f
commit f8cd7874ef
4 changed files with 7 additions and 3 deletions
@@ -69,7 +69,7 @@ const ArchiveManager = {
new InvalidZipFileError({ info: { totalSizeInBytes } })
)
}
const isTooLarge = totalSizeInBytes > ONE_MEG * 300
const isTooLarge = totalSizeInBytes > ONE_MEG * 6 * Settings.maxUploadSize // 6 * 50 MB = 300 MB
return callback(null, isTooLarge)
})
})
+3 -1
View File
@@ -368,7 +368,9 @@ module.exports = {
process.env.PROJECT_UPLOAD_TIMEOUT || '120000',
10
),
maxUploadSize: 50 * 1024 * 1024, // 50 MB
maxUploadSize: process.env.MAX_UPLOAD_SIZE
? parseInt(process.env.MAX_UPLOAD_SIZE, 10) * 1024 * 1024
: 50 * 1024 * 1024, // 50 MB
multerOptions: {
preservePath: process.env.MULTER_PRESERVE_PATH,
},