www.fromthevalley.com.au

Perl Script to Return a file

PERFECT for when you want to hide the URL of the file.

 

 

#!/usr/bin/perl



use CGI;

my $cgi = new CGI();


print $cgi->header(-type=>'application/pdf');

open FILE, "../../files/bids/B518024.pdf" or die $!;
binmode FILE;
my ($buf, $data, $n);
while (($n = read FILE, $data, 4) != 0) {
    $buf .= $data;
}
close(FILE);

print $buf;

HOME |  AJAX |  APACHE |  Bizphone |  CSS |  DNS |  General |  Graphics |  HTML |  Hardware |  Javascript |  Linux |  MAC |  MS SQL |  Mail |  Microsoft |  OFFICE 365 |  Perl |  Postgres |  SEO |  Social Media |  VMware |  Windows 10