Net::FTP problems getting files from Windows FTP server, but not Linux FTP Server.

Discussion in 'Perl Misc' started by D. Buck, Jun 25, 2004.

  1. D. Buck

    D. Buck Guest

    I have a perl script (I didn't write) running on HP-UX that gets .zip
    files from a Linux ftp server. It downloads the files and unzips
    them. Every thing works fine. My problem is if I try to use the same
    script on the same HP-UX box but try to get the (same) files from a
    Windows ftp server. The files download fine, but when it tries to
    unzip them, I get the following:
    --------------
    error [20040623064641.zip]: missing 273 bytes in zipfile
    (attempting to process anyway)
    error [20040623064641.zip]: attempt to seek before beginning of
    zipfile
    (please check that you have transferred or created the zipfile in
    the
    appropriate BINARY mode and that you have compiled UnZip properly)
    (attempting to re-compensate)
    /test/test20040623064641/0292409005.TIF bad CRC e1458190 (should be
    71c1779c)
    file #2: bad zipfile offset (local header sig): 57546
    (attempting to re-compensate)
    file #2: bad zipfile offset (local header sig): 57546
    file #3: bad zipfile offset (local header sig): 119940
    file #4: bad zipfile offset (local header sig): 170821
    ..
    ..
    ..
    --------------
    and so on....

    It is looking like it isn't successfully seting the mode to binary.
    Here is a part of the script that handles this:
    --------------
    my ($binaryflag) = 1;

    if ($binaryflag)
    {
    if ($ftp->type("binary"))
    {
    title_logger("DEBUG","non zero return from type");
    }else
    {
    title_logger("DEBUG","zero return from type");
    }
    }
    --------------

    The output of the title_logger sub routine is: DEBUG : zero return
    from type

    Any ideas why it isn't getting set to binary? Any thoughts on how to
    ensure it is set to binary?

    Thanks for any help you can give me.

    T.
    p8oust7eh+
    D. Buck, Jun 25, 2004
    #1
    1. Advertising

  2. D. Buck

    Sisyphus Guest

    Re: Net::FTP problems getting files from Windows FTP server, butnot Linux FTP Server.

    D. Buck wrote:
    > I have a perl script (I didn't write) running on HP-UX that gets .zip
    > files from a Linux ftp server. It downloads the files and unzips
    > them. Every thing works fine. My problem is if I try to use the same
    > script on the same HP-UX box but try to get the (same) files from a
    > Windows ftp server. The files download fine, but when it tries to
    > unzip them, I get the following:
    > --------------
    > error [20040623064641.zip]: missing 273 bytes in zipfile
    > (attempting to process anyway)
    > error [20040623064641.zip]: attempt to seek before beginning of
    > zipfile
    > (please check that you have transferred or created the zipfile in
    > the
    > appropriate BINARY mode and that you have compiled UnZip properly)
    > (attempting to re-compensate)
    > /test/test20040623064641/0292409005.TIF bad CRC e1458190 (should be
    > 71c1779c)
    > file #2: bad zipfile offset (local header sig): 57546
    > (attempting to re-compensate)
    > file #2: bad zipfile offset (local header sig): 57546
    > file #3: bad zipfile offset (local header sig): 119940
    > file #4: bad zipfile offset (local header sig): 170821
    > .
    > .
    > .
    > --------------
    > and so on....
    >
    > It is looking like it isn't successfully seting the mode to binary.
    > Here is a part of the script that handles this:
    > --------------
    > my ($binaryflag) = 1;
    >
    > if ($binaryflag)
    > {
    > if ($ftp->type("binary"))
    > {
    > title_logger("DEBUG","non zero return from type");
    > }else
    > {
    > title_logger("DEBUG","zero return from type");
    > }
    > }
    > --------------
    >
    > The output of the title_logger sub routine is: DEBUG : zero return
    > from type
    >
    > Any ideas why it isn't getting set to binary? Any thoughts on how to
    > ensure it is set to binary?
    >
    > Thanks for any help you can give me.


    To specify binary mode I use:
    $ftp->binary();

    This works fine for me for transferring files from my Windows FTP server
    to my Linux box.

    Hope the solution is _that_ simple :)

    Cheers,
    Rob

    --
    To reply by email u have to take out the u in kalinaubears.
    Sisyphus, Jun 25, 2004
    #2
    1. Advertising

  3. D. Buck

    D. Buck Guest

    You ROCK! Yes it was that simple. I wonder why the
    $ftp->type("binary") didn't work?

    Thank you.



    Sisyphus <> wrote in message news:<40dc244c$0$24771$>...
    >
    >
    > To specify binary mode I use:
    > $ftp->binary();
    >
    > This works fine for me for transferring files from my Windows FTP server
    > to my Linux box.
    >
    > Hope the solution is _that_ simple :)
    >
    > Cheers,
    > Rob
    D. Buck, Jun 29, 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. Christian Seberino
    Replies:
    2
    Views:
    435
    Christian Seberino
    Feb 12, 2004
  2. tak
    Replies:
    3
    Views:
    1,047
    Hunter Gratzner
    Sep 13, 2007
  3. Replies:
    3
    Views:
    1,461
    Rolf Magnus
    Jan 18, 2009
  4. bob Smith
    Replies:
    0
    Views:
    121
    bob Smith
    Oct 23, 2003
  5. Replies:
    3
    Views:
    195
    John Mason Jr
    Dec 18, 2004
Loading...

Share This Page