How do I actually upload an file e.g. image to sup...
# help
j
How do I actually upload an file e.g. image to supabase storage? The swagger api doesn't mention it or I might be blind.
n
Hello @Jan Tennert! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
n
TheRealJan (2022-05-28)
j
yes but how to I send the actual file? Not using javascript
b
That should be the endpoint of the API, though I always use the js api personally
If you expand that end point there's an example: folder/cat.png
j
I know that I just don't know how to send the actual data? Is it like a multipart request or is the file just the raw request body?
g
b
Copy code
private async uploadOrUpdate(
    method: 'POST' | 'PUT',
    path: string,
    fileBody:
      | ArrayBuffer
      | ArrayBufferView
      | Blob
      | Buffer
      | File
      | FormData
      | NodeJS.ReadableStream
      | ReadableStream<Uint8Array>
      | URLSearchParams
      | string,
    fileOptions?: FileOptions
  ):
looks like it'll take a lot of things
j
I already have that open but never really used js/ts
okay yes you can just provide the raw bytes in the request thanks
n
Thread was archived by @Jan Tennert. Anyone can send a message to unarchive it.