Skip to content

Transferring large files #710

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

Closed
manorit2001 opened this issue Jun 16, 2021 · 4 comments
Closed

Transferring large files #710

manorit2001 opened this issue Jun 16, 2021 · 4 comments
Labels

Comments

@manorit2001
Copy link

Hi, I couldn't find anything related to sending files across python-socket-io. Is there some method to share large binary files across the client and server?

@manorit2001 manorit2001 changed the title Transferring files Transferring large files Jun 16, 2021
@miguelgrinberg
Copy link
Owner

miguelgrinberg commented Jun 16, 2021

The Socket.IO protocol does not have anything specific to send files, but you can load the file contents and send them as a regular event, or if you want to do something fancy, you can also piece the data into smaller chunks and send the pieces, which may allow you to display a progress update.

@manorit2001
Copy link
Author

The Socket.IO protocol does not have anything specific to send files

oh okay

but you can load the file contents and send them as a regular event

I was actually trying this, but for large files the socket gets disconnected when trying to emit. Is there some flag or something which allows it to automatically break a large transmission to smaller chunks and send it? it might be a helpful feature ig which can allow bigger transmission if required

@miguelgrinberg
Copy link
Owner

miguelgrinberg commented Jun 16, 2021

As I said, there is nothing specific to sending large files, the protocol is really better suited to small payloads and low latency, not to do file transfers. In terms of performance you there is really no advantage versus doing a standard HTTP upload.

If you want to transfer a file in chunks you have to implement the chunk splitting and joining yourself.

@manorit2001
Copy link
Author

okay, thank you for the information. I am closing the issue

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

No branches or pull requests

2 participants