mtchuck has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl 1 use Net::FTP; 2 my $host="domain.org"; 3 my $directory="public_html/tmp"; 4 my $name="xxx.pdf"; 5 $ftp=Net::FTP->new($host,Timeout=>240); 6 $ftp->login("username","password"); 7 $ftp->cwd($directory); 8 $ftp->put($name); 9 $ftp->quit;
The above works fine. I've removed the error checking for brevity. It is in the cgi-bin folder on my web page server.
The file $name (xxx.pdf) must exist in the same folder as the perl program. (cgi-bin)
The file $name (xxx.pdf) is put into the folder "public_html/tmp".
What I want to do is get a file from my local machine (c:\tmp\xxx.pdf) and put it on the server in "public_html/tmp".
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ftp a file
by Illuminatus (Curate) on Oct 11, 2010 at 17:27 UTC | |
|
Re: ftp a file
by kcott (Archbishop) on Oct 11, 2010 at 18:19 UTC |