Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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 = "ftp.host.com"; $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 myscriptpath.pl every so often.


Comment on Re: How to upload file without using FTP?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://551416]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-08-22 22:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (168 votes), past polls