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>";
In reply to Bug in perl? by MaxDes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |