venkatesan_G02 has asked for the wisdom of the Perl Monks concerning the following question:
I am writing a small CGI script wherein the script will list all the files in a directory. I am able to list the files successfully but i am also trying to provide a link to the files which seems to have some problem.
In the below code, i have just showed the section where i provide the link to the file because i am able to get the list of files in the directory successfully
#!C:/Strawberry/Perl/bin/perl.exe use strict; use warnings; use diagnostics; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); my $cgi=new CGI; print $cgi->header(); print $cgi->start_html("My Submissions"); print "<body bgcolor=#c0c0c0>"; #Link to a sample file in the directory print "<h3><a href=\"file:///c:/temp/g.venkatesan/upload/test.txt\">Le +on</a></h3><br>"; print "</body>"; print $cgi->end_html();
The problem with this is, when i click on the link, the corresponding file is not opening. Infact, nothing is happening. But when i copy and paste the same link in a browser, the file is opening.
Could someone help me out with this issue? I have tried the code in both IE6 and Firefox 3.5.3
Thanks in advance!!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem linking a file in CGI script
by Corion (Patriarch) on Oct 29, 2009 at 16:30 UTC | |
by Anonymous Monk on Oct 29, 2009 at 17:02 UTC | |
by Corion (Patriarch) on Oct 29, 2009 at 17:17 UTC | |
by venkatesan_G02 (Sexton) on Oct 29, 2009 at 17:27 UTC | |
by Corion (Patriarch) on Oct 29, 2009 at 17:30 UTC | |
|
Re: Problem linking a file in CGI script
by jethro (Monsignor) on Oct 29, 2009 at 16:27 UTC |