I may just do a write/ready from disk for right no...
# help
m
I may just do a write/ready from disk for right now, but I'm curious to know if anyone has had experience with this error, or with uploading an ArrayBuffer instead of a File object.
I used the
fetch
API to build a
File
object from a data URL. The File object has a byte size of 1433680. I then use supabase to upload it:
Copy code
debug(`Made a File object with size ${encryptedFile.size}`);
    debug(`Attempting upload to supabase storage`);
    var { error: mediaError } = await supabase.storage
      .from("media")
      .upload(mediaPath, encryptedFile);
    if (mediaError) {
      fail(`Failed while uploading media ${JSON.stringify(mediaError)}`);
    }
    debug(`Finished uploading media file`);
and the error is null when the request is done. But the uploaded file on Supabase is zero bytes 😮
Oh, I feel silly, I was running an old version of the supabase client. Let's see if an upgrade helps
Hmm, no, an upgrade isn't helping
j
Did you ever solve this @User ? It's in the documentation, yet not working. My ArrayBuffer looks perfectly fine
m
@Jaeden sorry I didn’t follow up. I’m pretty sure it was the fact that I had an old library. I thought the upgrade hadn’t worked because I was using ‘npm’ commands when the project was using ‘yarn’
Once I finished the package upgrade with yarn things started working.
j
Odd. I'm on the latest client, but nope.
Thanks though! @User
Copy code
ArrayBuffer {                                                                                                       18:00:20
  [Uint8Contents]: <75 ab 5a 02 29 9a 81 ef e9 9e 00 1b 6a c7 ba e0 08 95 04 e4 70 d0 a1 a0 a0 00 00 00 d4 94 84 45 20 00 00 64 00 00 00 32 00 80 60 00 00 07 bc 0a e5 a0 00 00 00 17 35 24 74 20 0a ec e1 ce 90 00 02 00 04 94 44 15 47 89 ce cb dc fc f7 6d b9 11 d5 4e 7d ad d6 e0 7a bb b1 12 45 6e 80 40 15 18 46 c8 14 49 ... 346371 more bytes>,
  byteLength: 346471
}