I am working on a chat feature right now and was wondering if there was an easy way to send files over websockets.
So far I have been pretty unsuccessful, I have it working just fine over http but it seems to never receive my file when it gets to the other end with my websocket.
Also is it even a good idea to use websockets to send files back and forth, or should I just stick with http when someone wants to upload a file?
It's quite a hassle, since you have to take the file, split it into chunks and encode it, send the chunks separately, and then reassemble them on the other side. If you have the ability to use HTTP (from client to server for example), just send a message to the server indicating your interest to upload a file, and the server should give you back a URL for you to submit.