Add MAX_UPLOAD_SIZE environment variable

This commit is contained in:
Rudy ERCEK
2025-10-16 11:54:41 +02:00
committed by yu-i-i
parent 3a844ff46a
commit e9b5931cad
4 changed files with 7 additions and 3 deletions

View File

@@ -96,7 +96,7 @@ function _isZipTooLarge(source) {
)
return done(new InvalidZipFileError({ info: { totalSizeInBytes } }))
}
done(null, totalSizeInBytes > ONE_MEG * 300)
done(null, totalSizeInBytes > ONE_MEG * 6 * Settings.maxUploadSize)
})
})
})

View File

@@ -375,7 +375,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,
},