#!/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!
In reply to ftp a file by mtchuck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |