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

Add support/components for file upload #25

Closed
matijaSos opened this issue Feb 1, 2024 · 6 comments
Closed

Add support/components for file upload #25

matijaSos opened this issue Feb 1, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@matijaSos
Copy link
Collaborator

File upload is something that you often need, but it is never straightforward. If Open SaaS could help with that, that would be amazing!

@matijaSos matijaSos added the enhancement New feature or request label Feb 1, 2024
@Martinsos
Copy link
Member

Example gist that @infomiho made, for uploading from client to server and then to S3 or to disk: https://gist.github.com/infomiho/ec379df4e33f3ae3410a251ba3aa81af . This is a minimal, "simplistic" version to start with.

I would normally though recommend uploading directly to S3 / ... from the client, and using server only to sign the upload URLs, so it would be good to also have instructions for that.

@vincanger
Copy link
Collaborator

I would normally though recommend uploading directly to S3 / ... from the client, and using server only to sign the upload URLs, so it would be good to also have instructions for that.

what do you think the best way to approach this is @Martinsos? I'm thinking of adding components and operations to the OpenSaaS template for uploading to S3, and then adding the example in the gist above to the docs as an alternative.

@Martinsos
Copy link
Member

@vincanger I think that sounds like a good idea. The main PITA with the S3 approach is of course, configuring stuff on S3 -> if I remember well, configuring correctly permissions for the bucket is the trickiest part.

In the future, if we had Full Stack Modules (FSMs) for Wasp, this would be a great FSM that you could just plug in. But for now it sounds good to have this as part of the template itself.
Alternatively, it could be something like a "recipe", so it is not in the code immediately, but it is very easy to add -> either by just copying from the docs or even running some command.

@vincanger vincanger self-assigned this Feb 6, 2024
@vincanger
Copy link
Collaborator

sounds good @Martinsos. working on this now!

@vincanger
Copy link
Collaborator

file uploads are live and documented at https://docs.opensaas.sh/guides/file-uploading/

@awalmubarak
Copy link

Hey @vincanger , I noticed that using api.post() on the client side was causing a CORS error that I couldn't resolve but it vanished when I switched to fetch. If you're getting the same error at your end, I can update the docs to use fetch

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

No branches or pull requests

4 participants