MaxDes has asked for the wisdom of the Perl Monks concerning the following question:
this script, although it looks correct in syntax gives me a weird result. When running the script from command line the directory passes correctly, but when running it with a web browser through cgi I get the following: Cannot open local file S:\\Free\\name.ts: no such file or directory. I've tried simpler versions of the same code with chdir and such, but I get the same result... Can anyone help?#!C:\Perl\bin\perl.exe -w use CGI; use Net::FTP; my $q = new CGI; my $thefile = $q->param('filename'); $dir = 'S:/Free'; $ftpobj = Net::FTP -> new ("192.168.0.2"); $ftpobj -> login("cms","cm5u53r"); $ftpobj -> binary; $ftpobj -> put ("$dir\\$thefile"); $ftpobj -> quit; print "Content-type: text/html\n\n"; print "\n<html><head>"; print "<title>Uploading Complete</title>"; print "</head>"; print "<body><h2>Uploading Complete</h2><br><br>filename: [$filename] +thefile: [$thefile]<br><br>"; print "</body></html>";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bug in perl?
by kyle (Abbot) on Aug 05, 2008 at 20:11 UTC | |
by MaxDes (Initiate) on Aug 05, 2008 at 20:12 UTC | |
|
Re: Bug in perl?
by tilly (Archbishop) on Aug 05, 2008 at 20:08 UTC | |
|
Re: Bug in perl?
by eosbuddy (Scribe) on Aug 06, 2008 at 04:53 UTC | |
|
Re: Bug in perl?
by chakram88 (Pilgrim) on Aug 05, 2008 at 19:59 UTC | |
by MaxDes (Initiate) on Aug 05, 2008 at 20:03 UTC |