Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: How to upload file without using FTP?

by TedPride (Priest)
on May 24, 2006 at 17:18 UTC ( #551416=note: print w/replies, xml ) Need Help??

in reply to How to upload file without using FTP?

Net::FTP (which comes with the standard Perl installation) will make this a whole lot simpler. Just install Perl on your comp, and use something like the following:
use strict; use warnings; use Net::FTP; my ($ftp, $host, $user, $pass, $dir, $fpath); $host = ""; $user = "myuser"; $pass = "mypass"; $dir = "/www/htdocs"; $fpath = "D:\work for people\k****ij\oil1.shtml"; $ftp = Net::FTP->new($host, Debug => 0); $ftp->login($user, $pass) || die "Bad login"; $ftp->cwd($dir) || die "Unable to change directories"; $ftp->put($fpath) || die "Unable to upload file"; $ftp->quit; print "Success!";
Then if you don't want to have to run even this manually, set up an automatic job to call perl every so often.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://551416]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2018-06-19 18:31 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (114 votes). Check out past polls.