FTP Resume

S

Shweta

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.
 
P

Peter Johansson

Shweta said:
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
 
J

Jack Klein

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top