I use Socket.io for uploading files. It works fine with the following schema:
- Client: read file from input and encode it to Base64 and compress it
- Client: Emit a Socket.io event upload including compressed file as a piece of data
- Server: Listen to upload event, uncompress and decode file and save it
The problem occurs for large files: I cannot see a progress of data sent via client emit (like I do with XHR).
To solve these problems I have to track (check) upload progress of emit event. How can I do this?
I would like to listen to upload progress on CLIENT SIDE ONLY
Thanks to bnuhero, socketio-file-upload gives a possibility to listen to progress on server side and emit messages to client side when let's say every 5% or 20% is uploaded. So it means to send 20 or 5 messages respectively per file. I would like to listen to progress on client side.
Looks like there is no possibility to check the progress on client side with naked Socket.io. Io-stream solves that problem.