Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Answer: How can I FTP files from within PERL WITHOUT NET::FTP?

by Anonymous Monk
on Nov 14, 2000 at 13:00 UTC ( #41537=categorized answer: print w/replies, xml ) Need Help??

Q&A > HTTP and FTP clients > How can I FTP files from within PERL WITHOUT NET::FTP? - Answer contributed by Anonymous Monk

Hi,how about you try to play around with this code.It includes an FTP process.I'm trying to use UNIX embedded command inside the program, instead of using the NET::FTP.
#!/usr/bin/perl print "Content-type:text/html\n\n"; use File::Copy; $remotehost1 ="a"; $remotepath ="/b"; $remoteuser ="c"; $remotepass ="d"; @fileftp = qw(x.wml y.wml z.wml); $cmd="ftp -n"; foreach $wmlfile (@fileftp) { if(-f $wmlfile) { $ftp_commands = " open $remotehost1 user $remoteuser $remotepass cd $remotepath asc put $wmlfile bye "; open (CMD, "|$cmd"); print CMD $ftp_commands; close (CMD); print "File $wmlfile has been transferred \n"; print "<br>\n"; $finish = 'transfer'; copy ("$wmlfile","./$finish/$wmlfile"); } }

Hope,it will help. -VREMPIRE-

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2017-09-20 04:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (230 votes). Check out past polls.

    Notices?