FTP Resume

Discussion in 'C++' started by Shweta, Jan 8, 2004.

  1. Shweta

    Shweta Guest

    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.
     
    Shweta, Jan 8, 2004
    #1
    1. Advertising

  2. 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
     
    Peter Johansson, Jan 8, 2004
    #2
    1. Advertising

  3. Shweta

    Jack Klein Guest

    On 8 Jan 2004 02:21:49 -0800, (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/~ajo/docs/FAQ-acllc.html
     
    Jack Klein, Jan 9, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. someone

    FTP over SSL vs FTP over SSH

    someone, Apr 24, 2004, in forum: Java
    Replies:
    1
    Views:
    4,591
    iksrazal
    Apr 25, 2004
  2. Replies:
    3
    Views:
    5,656
  3. KGuru
    Replies:
    4
    Views:
    5,824
    Thomas Weidenfeller
    Mar 23, 2006
  4. Nico Grubert
    Replies:
    0
    Views:
    645
    Nico Grubert
    Nov 24, 2005
  5. D. Buck
    Replies:
    2
    Views:
    492
    D. Buck
    Jun 29, 2004
Loading...

Share This Page