-
October 2nd, 2010, 06:04 PM
#1
FTP Issues
Hi friends, I have learned enough to send and receive data between two computers via TCP protocol. I would like now to use this knowledge to move a file between them, however I still don t know very much about the structure of a file (of any extension: txt, doc, exe, pdf, )
Could you please tell me how can I split a file in its more elemental parts to send it as a String of characters?
Thanks in advance
-
October 2nd, 2010, 08:14 PM
#2
Re: FTP Issues
however I still don t know very much about the structure of a file (of any extension: txt, doc, exe, pdf, )
You don't need to know what kind of a file it is. All files are just binary data, so if you know how to send and receive data, you can also send a file.
Could you please tell me how can I split a file in its more elemental parts to send it as a String of characters?
You can't send or receive binary data with a CString, because a CString is text.
-
October 3rd, 2010, 06:21 AM
#3
Re: FTP Issues
So what is the function I have to use to open or display all the binary content of a file?
Regards
-
October 3rd, 2010, 08:19 AM
#4
Re: FTP Issues
You can use a CFile object to read a block of data and use a CSocket to send the data to the other side. Repeat this process until the complete file is send.
Here is a example on how to do that.
-
October 4th, 2010, 05:07 AM
#5
Re: FTP Issues
Thanks a lot. I´m going to look at it right now..
-
October 4th, 2010, 02:22 PM
#6
Re: FTP Issues
Originally Posted by Skizmo
Here is a example on how to do that.
The code at that link doesn't work and should not be used (for proof, read all the comments that say "doesn't work" or "large files are corrupted" or "can't open transferred file").
For a sample of code that works, together with an explanation of why the linked-to code does not, see "Network Transfer Of Files Using MFC's CSocket Class" at http://www.codeproject.com/KB/IP/Soc...eTransfer.aspx
-
October 4th, 2010, 02:37 PM
#7
Re: FTP Issues
The code at that link doesn't work and should not be used (for proof, read all the comments that say "doesn't work" or "large files are corrupted" or "can't open transferred file").
Oops ... Googled for an example, didn't really check the comments or anything. Thanx for correcting me.
-
October 7th, 2010, 02:18 PM
#8
Re: FTP Issues
Thanks a lot guys Iḿ now in the right way.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|