I wrote a c++ function to send a GET request with winsock, but when i send it to a .exe or any other binary file, it comes out all messed up. I'm storing the result of the request, the file data in a string, then writing it to a file with fstream. Is there some other way you have to do it ?