Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How to upload file without using FTP?

by TedPride (Priest)
on May 24, 2006 at 17:18 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-25 19:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found