View Single Post
  #7  
Old 11-06-2007, 07:45 PM
navaldesign's Avatar
navaldesign navaldesign is offline
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,288
Default Re: Text menu with PHP variable permission testing.

You can use a forced download code to make the pdf file download to the user's computer. Such a code allows you to define the name of the file as it will be downloaded, to be different from the real filename (which, in any case, is NOT revieled). This way, if anyone tries to download the file directly, simply doesn't find it (he gets a 404 error). Have a look at http://www.vodahost.com/vodatalk/blu...-play-mp3.html

By changing the line

header("Content-Disposition: attachment; filename=$filename");


to be

header("Content-Disposition: attachment; filename=$user_filename");

the file will be downloaded with whatever name you like (Like "Price List")

whilst $filename is the full (path/filename) name of the actual file.

For $filename i usually use a prefix_filename.pdf type, where the prefix is usually the md5() of $now = time(). So the file is actually saved on the server with the real name which will be something like sfa463aedsae4s4s53as553sd4545e_filename.pdf but is downloaded on the users computer as Price List
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Reply With Quote