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

D

D. Buck

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+
 
S

Sisyphus

D. Buck said:
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
 
D

D. Buck

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

Thank you.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,834
Latest member
BuyCannaLabsCBD

Latest Threads

Top