[@uplo/service-gcs] Uint8Array not implemented but looks supported ?
iRyusa opened this issue · comments
Maxime Brazeilles commented
Hi !
I don't know if i'm doing something wrong but in Bun I do :
await uplo.attachments.user(user.id).avatar.attachFile({
fileName: file.name,
content: Buffer.from(await file.arrayBuffer()),
contentType: file.type
})
The problem is:
Buffer.from(await file.arrayBuffer()) instanceof Uint8Array
returns true
So it throws because of this:
} else if (content instanceof Uint8Array) {
throw new Error("Uint8Array not implemented");
}
If I comment it, the file is uploaded properly tho, is there any reason you can't send a Buffer to GCS ?
Justas Palumickas commented
Hey!
Good question, last time I checked, GCS was not supported Unit8Array, but yea, we can try to impement this or just remove this line.
Maxime Brazeilles commented
Do you want a PR for this ? I'm trying to avoid fork+publish it possible 😅