#!/usr/bin/perl -wT $| = 1; $filename = "test.pdf"; print "Content-type: text/html\n\n"; print < 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 =~ /\.exe$/); 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 = ; close (FILE); print $file; } exit;