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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfering files using socket programming

Status
Not open for further replies.

drrep

Programmer
Mar 13, 2002
47
0
0
US
Hi all,

Ok, I looked everywhere over the net and no examples are shown on how to transfer a file from say a server to a client or vice versa. They only show how to transfer a message which is useless to me.

I am writing this program in C++ in order to transfer any kind of file between the server and client. I am assuming it does involve the send and recv functions someway as also perhaps the fread and fwrite for reading and writing a file.

Any help?? Thanks...

-Billy
 
Hello!

I'm not sure that I can help you, but you can try this!
If you are using the API object socket, you can send a string of bytes.You read the bytes from the file and the client recive them.If the file is very large, you can read the bytes and send them in multiple steps.
I am not aware of any fuctions similar to fread and fwrite to do this thing.
If you suced,let me know.
 
I do not really think, I can help you. But I could mention, that I have also tried to make such a file sharing program, but it does not work fully. It transfers all the data, but somewhere there are errors in it.
You could send me an e-mail for request, so you could get the source code, maybe as inspiration.
PS: I worked with Visual Studio.NET
 
I do not really think, I can help you. But I could mention, that I have also tried to make such a file sharing program, but it does not work fully. It transfers all the data, but somewhere there are errors in it.
You could send me an e-mail for request, so you could get the source code, maybe as inspiration.
PS: I worked with Visual Studio.NET

(mirr2001@web.de)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top