|
Re: Controlling access to pdf/doc files: msg#00110security.web-applications
I write like this in Perl: -Open the file -Write the correct Content-type -Write to the output sub download { # ---------- # download file my $type = $in{'type'}; if ($type eq "pdf") { open( IN, $PDF_FILE ) or die; #quit on error binmode(IN); print "Content-type: application/pdf\n\n"; } elsif ($type eq "zip") { open( IN, $ZIP_FILE ) or die; binmode(IN); print "Content-type: application/x-zip-compressed\n\n"; } while( read( IN, $i, 1024) ) { print $i; } close IN; } --Suhairi Mohd Jawi -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Security tool for monitoring HTTPS traffic?: 00110, najeeb . hatami |
|---|---|
| Next by Date: | OT: websphere webservice configuration: 00110, Mads Rasmussen |
| Previous by Thread: | RE: Controlling access to pdf/doc filesi: 00110, Noah Gray |
| Next by Thread: | RE: Security tool for monitoring HTTP headers: 00110, Brecrost Jones |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |