hopalong has asked for the wisdom of the Perl Monks concerning the following question:
FILE 2:#!/usr/bin/perl -wT $| = 1; $filename = "test.pdf"; print "Content-type: text/html\n\n"; print <<EOM; <FORM ACTION="b2.cgi?" METHOD="POST"> <INPUT TYPE="hidden" NAME="actiontype" VALUE="dload1/i"> <input type=hidden NAME="filename" value="$filename"> <INPUT TYPE="submit" VALUE="Download"> </form> EOM exit;
#!/usr/bin/perl -wT $| = 1; $filepath = "/path/httpdocs/folder/"; $filename = "test.pdf"; &read_input; if ($data{'actiontype'} =~ /dload1/i) { print "Content-type: application/octet-stream\n" if ($filename =~ /\.e +xe$/); print "Content-type: application/zip\n" if ($filename =~ /\.zip$/); print "Content-type: application/pdf\n" if ($filename =~ /\.pdf$/); print "Content-type: application/x-pdf\n" if ($filename =~ /\.pdf$/); print "Content-Disposition: inline; filename=$filename\n"; print "Content-Description: File to download\n\n"; open (FILE, "$filepath$filename"); local ($/); $file = <FILE>; close (FILE); print $file; } exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: download hidden files
by krisahoch (Deacon) on Aug 19, 2002 at 22:26 UTC | |
by hopalong (Initiate) on Aug 19, 2002 at 23:22 UTC | |
by krisahoch (Deacon) on Aug 20, 2002 at 02:59 UTC | |
by Anonymous Monk on Aug 20, 2002 at 06:24 UTC | |
|
Re: download hidden files
by Chady (Priest) on Aug 20, 2002 at 06:32 UTC | |
|
Re: download hidden files
by rattusillegitimus (Friar) on Aug 20, 2002 at 14:12 UTC | |
by hopalong (Initiate) on Aug 20, 2002 at 16:17 UTC |