forked from syntaxbullet/aurorabot
feat: Increase maximum image upload size from 2MB to 15MB.
This commit is contained in:
@@ -17,7 +17,7 @@ interface ImageUploaderProps {
|
||||
}
|
||||
|
||||
const ACCEPTED_TYPES = ["image/png", "image/jpeg", "image/webp", "image/gif"];
|
||||
const MAX_SIZE_DEFAULT = 2; // 2MB
|
||||
const MAX_SIZE_DEFAULT = 15; // 15MB
|
||||
|
||||
export function ImageUploader({
|
||||
existingUrl,
|
||||
|
||||
@@ -471,11 +471,11 @@ export async function createWebServer(config: WebServerConfig = {}): Promise<Web
|
||||
);
|
||||
}
|
||||
|
||||
// Check file size (max 2MB)
|
||||
if (buffer.byteLength > 2 * 1024 * 1024) {
|
||||
// Check file size (max 15MB)
|
||||
if (buffer.byteLength > 15 * 1024 * 1024) {
|
||||
await itemsService.deleteItem(item.id);
|
||||
return Response.json(
|
||||
{ error: "Image file too large. Maximum size is 2MB." },
|
||||
{ error: "Image file too large. Maximum size is 15MB." },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
@@ -666,10 +666,10 @@ export async function createWebServer(config: WebServerConfig = {}): Promise<Web
|
||||
);
|
||||
}
|
||||
|
||||
// Check file size (max 2MB)
|
||||
if (buffer.byteLength > 2 * 1024 * 1024) {
|
||||
// Check file size (max 15MB)
|
||||
if (buffer.byteLength > 15 * 1024 * 1024) {
|
||||
return Response.json(
|
||||
{ error: "Image file too large. Maximum size is 2MB." },
|
||||
{ error: "Image file too large. Maximum size is 15MB." },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user