You are here: Re: how to hide the url of a file for download « PHP Programming Language « IT news, forums, messages
Re: how to hide the url of a file for download

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация