
davorg
Thaumaturge
/ Moderator
Jul 31, 2003, 1:23 AM
Post #2 of 19
(1817 views)
|
|
Re: [tack] why ?my CGI code can't use FTP module!
[In reply to]
|
Can't Post
|
|
following is my code : #!/usr/bin/perl use Net::FTP; my $file="E:\\server\\Apache\\htdocs\\111\\time.txt"; $ftp=Net::FTP->new("tack.smice.net",timeout=>30); $ftp->login($user,"$password); $ftp->put($file,"tt.txt"); print "content-type:text/html\n\n"; it can runs on dos , but not on IE browser .is it wrong ? help! In what way does it fail to work? What unexpected behaviour areyou seeing? Are you getting any error messages? Is there anything in the web server error log? It's always a good idea to have "use strict" and "use warnings" in your Perl code as they can help you find several common problems. A couple of things I've spotted: 1/ You have an unnecessary double quote in the line
$ftp->login($user,"$password); Either remove it, or add another one to match it. 2/ Your content-type header is wrong. You should probably use the "header" function from CGI.pm to ensure that you get it right. -- Dave Cross, Perl Hacker, Trainer and Writer http://www.dave.org.uk/ Get more help at Perl Monks
|