Yes, this is Perl you can do almost anything! Assuming you have ftp access to your website you can use something like the Net::FTP module to FTP it up. See the docs for full details but here is a working example. Note you put in the IP address not the http:// part (we are using ftp afterall). The cwd() function changes the working dir and the put uploads the file to the cwd. There are all the other functions you might expect to make dirs etc.
use Net::FTP; my $webaddr = "www.foo.com"; my $username = "username"; my $password = "password"; my $target_dir = "www"; my $file = "c:/test.txt"; $ftp = Net::FTP->new( $webaddr ) or die $@; $ftp->login( $username, $password ) or die $ftp->message(); $ftp->cwd( $target_dir ) or die $ftp->message(); $ftp->put( $file ) or die $ftp->message(); $ftp->quit;
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Perl upload file
by tachyon
in thread Perl upload file
by ah_yee_00
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |