
Cure
User
Mar 9, 2000, 2:22 PM
Post #3 of 3
(330 views)
|
Hi This script should do what your asking for. I got it from the Administrator. use Net::FTP; # Items in bold are variables you need to set # Create new FTP object $ftp = Net::FTP->new($domain); # Log into $domain"; $ftp->login("$username","$password") | | die "Couldn't log in using usr: $username and pw: $password.\n"; # Change working remote directory $ftp->cwd("$fullpathtodirectory"); # See where you currently are on the remote server $dir = $ftp->pwd(); # Switch to ASCII mode $ftp->ascii; # Delete a file $ftp->delete($filetodelete) | | die "Could not delete $filetodelete.\n"; print "Upload successful.<P>"; # Upload a file $ftp->put("$filetoupload",$newfilename) | | die "Could not upload $filetoupload into $dir.\n"; # Get a file $ftp->get("$filetoretrieve"); # Make a habit of always including the quit line $ftp->quit(); Cure
|