Reputation: 1580
I can see WebSocketSharp implements an overload for Send(FileInfo file).
https://github.com/sta/websocket-sharp/blob/master/websocket-sharp/Server/WebSocketBehavior.cs
If I use this to send a file from the server, how can I receive and write this file on the client side? I can't find any methods to do this in the WebSocket class.
Thanks
Upvotes: 2
Views: 2518
Reputation: 171178
That file is being sent in the form of its contents. The WebSocket protocol has no special provisions to transfer files. It's just bytes (or text which does not apply here).
Read the bytes and copy them to a file. If you want to copy over the file name you need to devise a protocol to do that.
Upvotes: 1