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

File uploads #48

Open
jfyne opened this issue Feb 9, 2022 · 3 comments
Open

File uploads #48

jfyne opened this issue Feb 9, 2022 · 3 comments

Comments

@jfyne
Copy link
Owner

jfyne commented Feb 9, 2022

Was playing around with this project and wanted to be able to do file uploads. My form submits the event, but I'm noticing that the event is missing all the data.

{"t":"upload","i":1,"d":{"myFile":{}}}

I just skimmed the project, but from what I can tell, you'd need to slice the file into smaller chunks to send over WebSocket stream, then reassemble the file on the server side. It'd probably require reworking LiveEvent and Socket.send to support this lower level operation?

Maybe I'm missing something and this already works, if so it'd be a good example to have.

Originally posted by @silasb in #47

@silasb
Copy link

silasb commented Feb 23, 2022

Added an example repo of this working. https://github.com/silasb/live-upload-example I've vendored things to make it easier to "hack" on this.

@jfyne
Copy link
Owner Author

jfyne commented Feb 23, 2022

Ill take a look, thanks!

@jfyne
Copy link
Owner Author

jfyne commented Apr 6, 2022

@silasb I've done an initial pass at this. Although I used a POST. I don't like my approach, and I am going to switch to using the web socket to do it like your example.

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

2 participants