2

I am wondering what the best option for sending a file would be.

I have to upload a cvs file to a server to be processed and then wait for the results of the process.

So far I convert the file to binary data like this:

let data = try Data(contentsOf: <URL>, options: .mappedIfSafe)
socket.write(data: data)

And it sends something, but I'm unsure how to handle that on the server side (Nodejs with websocket)

Is there another way to do this? I know using simple http methods I can send a file as it is, but I can't find a way with StarsCream.

Thanks in advance...

Danf
  • 1,409
  • 2
  • 21
  • 39
  • How you solved your problem? – Aanchal Chaurasia Dec 28 '18 at 08:03
  • I never solved it actually. I used SocketIO, which is a higher level library that makes some things easier. The most important thing is there is so much more reading and support for socketIO. – Danf Dec 28 '18 at 20:12

0 Answers0