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

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

by Anonymous Monk
on Nov 14, 2000 at 13:00 UTC ( [id://41537]=note: print w/replies, xml ) Need Help??


in reply to How can I FTP files from within PERL WITHOUT NET::FTP?

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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://41537]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-23 20:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found