I am try to print the filename with path from input tag. But it prints only file name not print with path.
My html script
<html>
<head>
<title>test</title>
</head>
<body>
<form action="file.pl" method="post">
<input type = "file" name = "name">
<input type = submit>
</form>
</body>
</html>
My perl script
use CGI;
$cgi = CGI->new();
$filename = $cgi-> param('name');
print "$filename";
In above script i select the file from D:\\new_folder\\file.txt it prints only the file.txt how can i change it.
This has nothing to do with Perl. You could program a web browser that would do this, but real browsers have stopped passing the full path name for good reason. For example, see Firefox bug report #143220 :
John Keiser (jkeiser) 2002-08-31 13:57:11 PDT
There is no spec that says that, but we explicitly try not to send it to avoid sending information about the user's local filesystem.
See also the release notes for Firefox 3 :
File upload fields
In prior versions of Firefox, there were cases in which when the user submitted a file for uploading, the entire path of the file was available to the web application. This privacy concern has been resolved in Firefox 3; now only the filename itself is available to the web application.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.