f



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

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+
0
triumpht5 (5)
6/25/2004 12:18:23 PM
comp.lang.perl.misc 33233 articles. 2 followers. brian (1246) is leader. Post Follow

2 Replies
1330 Views

Similar Articles

[PageSpeed] 49

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.

0
Sisyphus
6/25/2004 1:05:24 PM
You ROCK!  Yes it was that simple. I wonder why the
$ftp->type("binary") didn't work?

Thank you.



Sisyphus <kalinaubears@iinet.net.au> wrote in message news:<40dc244c$0$24771$5a62ac22@per-qv1-newsreader-01.iinet.net.au>...
>
> 
> 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
0
triumpht5
6/29/2004 2:05:03 PM
Reply: