We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02276b4 commit a651036Copy full SHA for a651036
1 file changed
app/api/user/avatar/route.ts
@@ -12,10 +12,9 @@ const REMOVE_URL = "https://upload.cornellappdev.com/remove";
12
const APPDEV_BUCKET = "alumni-website";
13
14
async function uploadToAppDev(buffer: Buffer, filename: string): Promise<string> {
15
- const blob = new Blob([new Uint8Array(buffer)], { type: "image/webp" });
16
const form = new FormData();
17
form.append("bucket", APPDEV_BUCKET);
18
- form.append("image", blob, filename);
+ form.append("image", new File([new Uint8Array(buffer)], filename, { type: "image/webp" }));
19
const res = await fetch(UPLOAD_URL, { method: "POST", body: form });
20
if (!res.ok) throw new Error("Upload failed");
21
return (await res.text()).trim();
0 commit comments