Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending binary files

Status
Not open for further replies.

mattias1975

Programmer
Jul 26, 2004
36
SE
Hello!

Does anyone know how to send binaryfiles(.exe) with sockets?
Not text files. Thats easy. I already know how to do that.
Some example code would be great.

Thank you.
 
Same way you send text files I imagine, with two points to note.
1. Open the files in binary mode "rb" and "wb"
2. Send an initial message containing the length of the file, so the receiver knows when it has received all the data.

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top