|  | Posted by Alvaro G Vicario on 07/01/05 11:23 
*** _andrea.l wrote/escribió (Fri, 01 Jul 2005 07:59:43 GMT):> I'd like to let user download a file but I'd like to hide the url of the
 > file.
 
 Downloading a file from a hidden URL is like calling someone whose phone
 number is unknown...
 
 
 > ... how can I write download_file.php?
 
 Given that what you really want to know is how to write a download script,
 I've found this example in the manual page for header():
 
 
 <?php
 // We'll be outputting a PDF
 header('Content-type: application/pdf');
 
 // It will be called downloaded.pdf
 header('Content-Disposition: attachment; filename="downloaded.pdf"');
 
 // The PDF source is in original.pdf
 readfile('original.pdf');
 ?>
 
 
 It shouldn't be difficult to write a generalization.
 
 --
 -- Álvaro G. Vicario - Burgos, Spain
 -- http://bits.demogracia.com - Mi sitio sobre programación web
 -- Don't e-mail me your questions, post them to the group
 --
  Navigation: [Reply to this message] |