Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Net::FTP and Zip files

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


in reply to Net::FTP and Zip files

Funny...
#!/usr/bin/perl use warnings; use strict; use Net::FTP; my $ftp = Net::FTP->new("ftp.cdrom.com") or die "Couldn't connect: $@\n"; $ftp->login("ftp", 'warez@'); $ftp->cwd("/.2/simtelnet/gnu/djgpp/v2/"); $ftp->binary; $ftp->pasv; $ftp->get("faq230s.zip"); $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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-19 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found