+ 2
is it possible to send files from socket.io ?
if it is possible, is it a good idea to do so ? or should i just rely on rest
4 Antworten
+ 1
You can read this blog
https://socket.io/blog/introducing-socket-io-1-0/#Binary-support
+ 5
Rei As others have answered... yes... Socket.io supports the ability to transfer files.
Whether it's a good idea or not will depend on your specific use case, expected frequency of uploads, expected size of files, whether or not you're supporting mobile devices as clients, etc.
For simple scenarios involving periodic upload of small files, the implementation is rather straight forward.
However, in cases, where you'll need to upload larger files, you'll want to use a NodeJS middleware called Multer for multipart/form-data support to send chunks of your file at a time.
I'm including a few links I've vetted that should help you figure this out.
----
Socket.io File Upload
--
https://medium.com/@Mewsse/file-upload-with-socket-io-9d2d1229494
https://docs.feathersjs.com/cookbook/express/file-uploading.html
https://blog.feathersjs.com/http-vs-websockets-a-performance-comparison-da2533f13a77
----
Understanding Socket.io
--
https://hpbn.co/websocket/
https://www.ably.io/concepts/socketio
+ 1
Yes!! socket.io has binary support
0
oooh thank you! its so hard to navigate the socket.io docs in mobile