in reply to Re^3: How Do I Use Net::FTP
in thread How Do I Use Net::FTP
The file does not copy into my Temp folder on my c: drive. Possible answers? Thanks#!/usr/local/bin/perl -w use Net::FTP; use Sys::Hostname; $hostname = hostname(); $hostname = '*****.com'; # ftp host $username = '*******'; # username $password = '*******'; # password $home = '/doytest/cgi-bin/Data/*.txt'; $ftp = Net::FTP->new($hostname); # Net::FTP constr +uctor $ftp->login($username, $password); # log in w/userna +me and password $pwd = $ftp->pwd; # get current dir +ectory open my $filehandle, '>', 'c:/Temp/00000001.610' or die "Couldn't open output file.\n$!"; $ftp->get("00000001.txt", $filehandle); close $filehandle or die "Couldn't close output file.\n$!"; # Now, output HTML page. print <<HTML; Content-type: text/html <HTML> <HEAD> <TITLE>Download Files</TITLE> </HEAD> <BODY> <B>Current working directory:</B> $pwd<BR> Files to download: <P> HTML @entries = $ftp->ls($home); # slurp all entr +ies into an array print "@entries \n\n"; print "$filehandle\n"; print <<HTML; </BODY> </HTML> HTML $ftp->quit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How Do I Use Net::FTP
by davido (Cardinal) on May 17, 2005 at 19:41 UTC | |
|
Re^5: How Do I Use Net::FTP
by radiantmatrix (Parson) on May 17, 2005 at 20:40 UTC |