473,288 Members | 1,704 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,288 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 2947


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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
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
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.