The MSDN shows how to use the API TransmitFile() to send a file over a conneciton-oriented socket.. but it does not show you how to receive it!
Is it done with the recv function or is it done in any other way?
I want this becouse I'm making a chat program. By now it is a frame with a menubar with two (useful, there are more non-useful) entries. Both options creates a child window, but server option sets up a server, and client options conects to a server.
I'm a bit strucked in the function of sending and receiving files. So any help is wellcome
Ok, but another question, Is there a function to know when it's a file and not text? and How to rebuild the file on the receiver side?
You have to build a mechanism (protocol) so the receiver knows received data has to be saved into file.
To rebuild the file, just save all receive data into file, but as i mention above, you have to build a mechanism how to transfer the file. The good example may be FTP protocol.
henky
---------------------------------- henky@nok.co.id is not my email address anymore... Jangan Pernah Menyerah
I forgot to tell you. There is no function to know received data is a file data or just a text.
I suggest you to see RFC959 (File Transfer Protocol) as an example.
Bookmarks