[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

param('file')

my html file contains
<input type=\"file\" name=\"file\" />

inmy cgi, i do
$query = new CGI;
$w = $query->param('file');
print "file: $w";

instead of printing "file: C:\test"  it is only printing "file: test"
0
perlperl
Asked:
perlperl
  • 6
1 Solution
 
perlperlAuthor Commented:
if the file is c:\test\eval.doc
then it only prints eval.doc
it is not printing complete path
0
 
perlperlAuthor Commented:
strange if i run on host A where apache is installed, i have thi sissue, but when i run on different host B, it prints complete path.....
0
 
perlperlAuthor Commented:
this is something i found out

if i write c:\test\eval.doc  then it prints evail.doc
if i give  :\test\eval.doc  then it prints ":\test\eval.doc"
it does not like if there is c: or d:  why??
0
Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

 
perlperlAuthor Commented:
1 more thing i tried

<input type=text name=user size=20/>
<input type="file" name="filename" />


in CGI
$query = new CGI;
$w = $query->param('filename');
$n  = $query->param('user');
print "file: $w , size = $s <br>";
print "name: $n <br>";
exit 0;

if i give "C:\test" for user, it prints "c:\user"
but if i give "c:\test\eval.doc" for file, it only prints eval.doc
0
 
perlperlAuthor Commented:
i tried using get to see what the form is sending....
on the url i saw
user=c%3A%5Ctest&filename=eval.doc&Submit=....................

which means the form itself is not sending the complete path................
0
 
ahoffmannCommented:
check your browser, not a web server or CGI problem
0
 
perlperlAuthor Commented:
well, it worked after adding these two lines

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now