Uploaded files to supabase is only 15 bytes and is empty
Hi, I'm trying to upload an image to my supabase bucket, the problem is that the image file is blank and only has 15 bytes. The file uploaded should be an image, and have at least 1.59mb as its size.
This is the code:
I've tried the following:
1. Upload the image to supabase manually as a test (Image is uploaded properly, so I ruled out that bucket policies isn't causing this problem)
2. Check the image file properties that I receive from the HTTP methods (The image contains the proper filename, mime type, etc.)
3. Try to use base64-ArrayBuffer library as can be seen the in the docs (Didnt work, same issue)
Any ideas?


4 Replies
Usually this means you are uploading the file object and not the file data.
Oh
The first picture I sent is telling me that I am getting the file correctly from POST
so it means the issue must be how I'm passing over the file data then?
Yes. Supabase I believe can only deal with passing in the file object in a browser environment. Otherwise you have to pass in the data and also usually set the content-type. But I'm not that familiar with the process for that. I assume since you are node (I think) you have to pass the actual file data.
https://github.com/orgs/supabase/discussions/2336
I'll look into this, thank you!
I finally got it to work, I had to convert the file to a base64 before I upload it to supabase. Thanks again!
Here's the code for anyone who might encounter this in the future.