This commit is contained in:
hailin 2025-06-26 12:22:51 +08:00
parent 34d8a59fd4
commit 476d33797a
1 changed files with 5 additions and 5 deletions

View File

@ -9,13 +9,13 @@ export const uploadFile = async (
file_id: string
}
) => {
const SIZE_LIMIT = parseInt(
process.env.NEXT_PUBLIC_USER_FILE_SIZE_LIMIT || "104857600"
)
// const SIZE_LIMIT = parseInt(
// process.env.NEXT_PUBLIC_USER_FILE_SIZE_LIMIT || "104857600"
// )
const SIZE_LIMIT = Number(process.env.NEXT_PUBLIC_USER_FILE_SIZE_LIMIT) || 104857600;
if (file.size > SIZE_LIMIT) {
throw new Error(
`File must be less than ${Math.floor(SIZE_LIMIT / 104857600)}MB`
`File must be less than ${Math.floor(SIZE_LIMIT / 1048576)}MB`
)
}