Check out Net::FTP, which gives you a Perl interface into FTP. The rest I leave as an exercise for the reader =)
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
| [reply] |
Also, if you want to try and make the username/password thing less of an issue, use .netrc (netrc(4)) for the ftp client. Most if not all ftp clients use it. You could use a simple shell script to send everything to the remote host that way, or you can even use the username/password in the shell script itself (which is less desirable security wise).
----------
- Jim | [reply] |
If security (i.e. passwords and such) is an issue for you, might I suggest looking at the alternatives?
SCP, an encrypted drop-in replacement for FTP, is a great alternative, and there is even a Net::SCP module that should allow you to keep using your current scripts, even if they currently rely on Net::FTP.
To use it, you just need to make sure your web host provides Secure Shell access instead of telnet, although my suspicion is that if they are allowing FTP they are probably allowing Telnet access too, since they both allow usernames/password combinations to be passed in plain text.
Anyway, I've had enough problems with FTP on my sites that I'm starting to move away from using ftpd at all, since the majority of the servers on the web are quite swiss-cheesy.
To 'automagically' upload your file, just schedule a task using cron, to trigger your file upload script. Cron will work for task automation and scheduling, no matter if you choose to use FTP or SCP for file transfer. Good luck! | [reply] |
What you need is to look into the Net::FTP - FTP Client class. You can put together a simple script using this Module
use Net::FTP;
$ftp = Net::FTP->new("some.host.name");
$ftp->login("anonymous","me@here.there");
$ftp->cwd("/pub");
$ftp->put("that.file");
$ftp->quit;
| [reply] |