Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Net::FTP and Zip files

by sachmet (Scribe)
on Mar 19, 2001 at 12:11 UTC ( #65386=note: print w/replies, xml ) Need Help??

in reply to Net::FTP and Zip files

#!/usr/bin/perl use warnings; use strict; use Net::FTP; my $ftp = Net::FTP->new("") or die "Couldn't connect: $@\n"; $ftp->login("ftp", 'warez@'); $ftp->cwd("/.2/simtelnet/gnu/djgpp/v2/"); $ftp->binary; $ftp->pasv; $ftp->get(""); $ftp->close; print "Th Th Tha That's All Folks!!!!!", "\n";
(file chosen at random from simtelnet at cdrom)

This works as expected, and the zip downloads fine, at least on a UNIX system. One other thing I'd try: place binmode() towards the top of the program; see how that fares. Perl may be converting your "\n" to "\r\n", which is not what you'd want.

Further, check the return of $ftp->get for the filename and check the filesizes to see if they're identical. Also, make sure the file doesn't exist first on the local side, if at all possible.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://65386]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2021-04-20 13:15 GMT
Find Nodes?
    Voting Booth?

    No recent polls found