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

nhost.storage.upload() incompatible with nhost functions. #876

Closed
philinit opened this issue Aug 8, 2022 · 1 comment · Fixed by #893
Closed

nhost.storage.upload() incompatible with nhost functions. #876

philinit opened this issue Aug 8, 2022 · 1 comment · Fixed by #893

Comments

@philinit
Copy link

philinit commented Aug 8, 2022

Issue:
nhost.storage.upload() requires a file of type File in StorageUploadParams. FIle is not yet introduced in node.js making .upload() only compatible with browsers. - Can't upload files from a serverless function or other node.js servers.

Suggestion:
Introduce an alternative to File in StorageUploadParams that is compatible with Node.js, so that nhost.storage.upload() can be used from a serverless function or any other Node.js environment.

Why?

  • When you want to generate/modify/check files on the server-side before uploading them to storage.
  • Sending large files back to the users' browser, only for uploading is not very efficient.
  • This would make hasura-storage-js compatible with both the backend and frontend. (Other functions like nhost.storage.delete works fine in serverless functions!)
@elitan elitan linked a pull request Aug 23, 2022 that will close this issue
@elitan
Copy link
Contributor

elitan commented Aug 25, 2022

It should be fixed in the latest release. You can see how it's done in our tests:

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

Successfully merging a pull request may close this issue.

2 participants