Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server side storage upload #5

Closed
IHIutch opened this issue May 4, 2021 · 9 comments
Closed

Server side storage upload #5

IHIutch opened this issue May 4, 2021 · 9 comments
Assignees

Comments

@IHIutch
Copy link

IHIutch commented May 4, 2021

Feature request

Be able to upload via server side as mentioned here supabase/supabase#1002

@inian
Copy link
Member

inian commented May 4, 2021

Hi @IHIutch, we are going to be working on this for the next storage milestone. Transferring the issue to our storage-js repo

@inian inian transferred this issue from supabase/supabase May 4, 2021
@IHIutch
Copy link
Author

IHIutch commented May 4, 2021

Awesome! Any ideas on an ETA?

@inian
Copy link
Member

inian commented May 4, 2021

Around 30 days away. In the meantime you can interact with our backend API directly.

@IHIutch
Copy link
Author

IHIutch commented May 4, 2021

Rock on, you guys are great. Thanks!

@inian
Copy link
Member

inian commented Jun 10, 2021

Some options off the top of my head

  • Right now storage-js uses FormData which is present in the browser, but not in Node.js. I don’t want to add a polyfill for that since it increases the bundle size
  • We could have a separate API call in storage-api which takes in a Blob or Buffer or Stream and call that API in Node environments probably.
  • I am not sure how S3 does it - cos I think upload to S3 works from both the browser and the server. So probably worth exploring that.

We can create separate bundles for Node.js and Browser and as long as we don’t have the FormData polyfill in the browser bundle, we should be okay cos the bundle sizes in Node doesn’t matter much. But again not sure how other environments like Flutter, React Native, etc would map to them

@danalloway
Copy link

danalloway commented Jun 14, 2021

  • We could have a separate API call in storage-api which takes in a Blob or Buffer or Stream and call that API in Node environments probably.

This would be amazing for all of my use cases!

I'm parsing a Multipart file upload request from the browser on the Server and end up with a Buffer / Stream, if I could just POST that to Supabase Storage API that would be SO ergonomic.

@inian
Copy link
Member

inian commented Jun 15, 2021

Hi @danalloway, I have a PR for this - supabase/storage#29. Check out the example there where you can directly send a stream or a Buffer to the backend.

Does that work for you?

inian added a commit that referenced this issue Jul 19, 2021
feat: #5 support server side storage upload
inian added a commit that referenced this issue Jul 19, 2021
feat: #5 document `Buffer` and `NodeJS.ReadableStream` support
@thebengeu
Copy link
Member

ArrayBuffer, ArrayBufferView, Blob, Buffer, File, FormData, NodeJS.ReadableStream, ReadableStream<Uint8Array>, URLSearchParams and string are now supported by from.upload() and from.update().

@homerjam
Copy link

ArrayBuffer, ArrayBufferView, Blob, Buffer, File, FormData, NodeJS.ReadableStream, ReadableStream<Uint8Array>, URLSearchParams and string are now supported by from.upload() and from.update().

It would be super helpful to reference this in the docs : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants