Skip to content

Commit a651036

Browse files
committed
Use file not blob?
1 parent 02276b4 commit a651036

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

app/api/user/avatar/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ const REMOVE_URL = "https://upload.cornellappdev.com/remove";
1212
const APPDEV_BUCKET = "alumni-website";
1313

1414
async function uploadToAppDev(buffer: Buffer, filename: string): Promise<string> {
15-
const blob = new Blob([new Uint8Array(buffer)], { type: "image/webp" });
1615
const form = new FormData();
1716
form.append("bucket", APPDEV_BUCKET);
18-
form.append("image", blob, filename);
17+
form.append("image", new File([new Uint8Array(buffer)], filename, { type: "image/webp" }));
1918
const res = await fetch(UPLOAD_URL, { method: "POST", body: form });
2019
if (!res.ok) throw new Error("Upload failed");
2120
return (await res.text()).trim();

0 commit comments

Comments
 (0)