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

Upload file with metadata to later download file with "orginalname" #645

Open
mstephano opened this issue Sep 3, 2021 · 2 comments
Open

Comments

@mstephano
Copy link

Is your feature request related to a problem? Please describe.
Currently, it seams that passing metadata to storage.put() is not currently implemented in nhost-js-sdk: https://github.com/nhost/nhost-js-sdk/blob/9d3d34c29e4c078abb591fcdc96eee4728c2e5f6/src/Storage.ts#L54

Describe the solution you'd like
I would like to be able to save the "originalname" of the file as metadata so it can be downloaded using that originalname like the example from Hasura: https://hasura.io/blog/building-file-upload-downloads-for-your-hasura-app/.

Currently the header "Content-Disposition" is missing "filename" like in the Hasura example in order to retrieve the file using the "originalname":

res.set('Content-Disposition', `inline;`)

Additional context
This feature would allow us to save every file as unique using uuidv4() but still retrieve as the filename that was originally uploaded.

@mstephano mstephano changed the title Upload file with metadata to later download file with "orginialname" Upload file with metadata to later download file with "orginalname" Sep 3, 2021
@mstephano
Copy link
Author

For those interested, my commit works as I described:
mstephano@5ea8eab

@mstephano
Copy link
Author

For information, I forgot to mention that I am using the create-react-app typescript example as web app:
https://github.com/nhost/nhost-react-typescript-example-app

Note: I know the project as been archived but I needed an example using create-react-app with typescript in order to try nhost.

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

1 participant