By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,649 Members | 2,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,649 IT Pros & Developers. It's quick & easy.

FTP Resume

P: n/a
Hi,

We are trying to buid an application in c++ which will have FTP
download and FTP resume download facility.FTP download is working
fine but there is a problem with resume download.

For FTP resume download the approach is,

1.Using FTPCommand() winAPI and issuing 'REST offset' command.then
using
'RETR filename' command to retrive the file from the given
offset.However the second command is failing.

The code snipet is

sRequest.Format(_T("REST %d"), 0);
//Send the resume request
HINTERNET *phFtpCommand = NULL;
BOOL bSuccess = FtpCommand(hFTPSession, FALSE, FTP_TRANSFER_TYPE_ASCII
, sRequest, 0, phFtpCommand);
//the above call succeeds

sRequest.Format("RETR TestFTP/Test.txt");
bSuccess = FtpCommand(hFTPSession, 1, FTP_TRANSFER_TYPE_ASCII ,
sRequest, 0, phFtpCommand);

The above function is failing.GetLastError() says that the parameter
is incorrect.

any pointers on how FTP resume is to be implemented are welcomed.
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


Shweta wrote:
Hi,

We are trying to buid an application in c++ which will have FTP
download and FTP resume download facility.FTP download is working
fine but there is a problem with resume download.

For FTP resume download the approach is,

1.Using FTPCommand() winAPI and issuing 'REST offset' command.then
using
'RETR filename' command to retrive the file from the given
offset.However the second command is failing.

The code snipet is

sRequest.Format(_T("REST %d"), 0);
//Send the resume request
HINTERNET *phFtpCommand = NULL;
BOOL bSuccess = FtpCommand(hFTPSession, FALSE, FTP_TRANSFER_TYPE_ASCII
, sRequest, 0, phFtpCommand);
//the above call succeeds

sRequest.Format("RETR TestFTP/Test.txt");
bSuccess = FtpCommand(hFTPSession, 1, FTP_TRANSFER_TYPE_ASCII ,
sRequest, 0, phFtpCommand);

The above function is failing.GetLastError() says that the parameter
is incorrect.

any pointers on how FTP resume is to be implemented are welcomed.


Sure, just read RFC959 http://www.ietf.org/rfc/rfc0959.txt

/ Peter

Jul 22 '05 #2

P: n/a
On 8 Jan 2004 02:21:49 -0800, sh*********@wipro.com (Shweta) wrote in
comp.lang.c++:
Hi,

We are trying to buid an application in c++ which will have FTP
download and FTP resume download facility.FTP download is working
fine but there is a problem with resume download.


[snip]

What is your question about the C++ language which has no built-in
support for networking?

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.