Respected Perl Monks! I am a Perl beginner with just a few days of perl learning experience. I am trying to create a CGI script which can display files in a folder and after clicking the file should be downloaded. I can see the list of files, but i am unable to download the file. Can you please help? here is my script:
#!C:/Dwimperl/perl/bin/perl.exe use 5.010; use strict; use warnings; use CGI; my $dir='C:/Perl64/bin/'; opendir (DIR, $dir); my $file=readdir DIR; my $cgi = CGI->new(); print $cgi->header(),$cgi->start_html(); print $cgi->start_ul(); while ($file = readdir DIR) { #print $cgi->h1($file); my $anchor=$cgi->a({ 'href' => "$dir"."$file" }, $file); print $cgi->li($anchor); } closedir DIR; print $cgi->end_ul(),$cgi->end_html();
When I click on blue anchors, nothing happens!
In reply to Perl cgi script for directory listing and file downloading!! Problem: Unable to download the file by masood91
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |