473,322 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

FTP Resume

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
2 2950


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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: jason | last post by:
Is there a way to avoid On Error Resume Next for: cnn.Open strCon SQL = "EXEC Customer @txtEmail='" & email_address & "'" set rs = cnn.execute(SQL) 'On error resume next rs("email_address")...
2
by: Ian DeRock | last post by:
I'm fairly new to XML. As I can see it, XML is a way to organize data like in a table in a RDB, or the RDB itself. I have used XML in application data, but did not design the actual XML. I...
2
by: Darta | last post by:
OK- I volunteer to be shot if this question is stupid... BUT, is there a way to, when you catch an exception in the catch{} handler, resume to the same line of code that generated an error while...
2
by: juky | last post by:
Hi all, I have a loop in the thread checking for a particular service status, whenever the status changes to "stopped" a RaiseEvent is generated by thread and another function runs. At the same...
3
by: bob.needler | last post by:
I know On Error Resume Next is generally considered lazy. But can someone tell me why the resume next in Exit_Handler does not seem to work? It generates the typical unhandled runtime error...
7
by: fniles | last post by:
In VB 6.0 in the error trapping, we can do "resume next" to continue on the next code. How can we do that in .NET with "Try", "Catch","End Try" ? Thanks
4
by: Neo | last post by:
I found on error resume next doesn't work in for each... e.g. on error resume next for each x in y 'do stuff next if you have an error in for each loop, it falls in infinite loop... it...
11
by: Maxwell2006 | last post by:
Hi, I know that this is not a good practice, but I wonder do we have "on error resume next" in C#? Thanks,
0
MMcCarthy
by: MMcCarthy | last post by:
Organizing a Resume Pertinent information included on your resume may be organized in a variety of ways. Regardless of the type of resume used, you should include the following: Contact...
3
by: sriharikabattula | last post by:
hi, i am uploading .doc,.docX,rtf files during registration level and that path can be saved in database(i am using database MYSQL).when user want to see his resume he/she can login and retrive...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.