This commit is contained in:
parent
34d8a59fd4
commit
476d33797a
|
|
@ -9,13 +9,13 @@ export const uploadFile = async (
|
||||||
file_id: string
|
file_id: string
|
||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
const SIZE_LIMIT = parseInt(
|
// const SIZE_LIMIT = parseInt(
|
||||||
process.env.NEXT_PUBLIC_USER_FILE_SIZE_LIMIT || "104857600"
|
// 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) {
|
if (file.size > SIZE_LIMIT) {
|
||||||
throw new Error(
|
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`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue