You are here: Re: Protecting unauthorized viewing of non-php files « PHP Programming Language « IT news, forums, messages
Re: Protecting unauthorized viewing of non-php files

Posted by Hans van Kranenburg on 10/06/47 11:18

DMacedo wrote:
> Place the PDF outside of the web root and use readfile()
> http://php.net/readfile function after verifying the user in a
> download script, along with this, you should send the needed header()
> http://php.net/header (filesize, type, forcing download if you wish,
> etc).

Additionaly, you can use mod_rewrite to rewrite urls to the script.

e.g. when using http://www.foo.com/download/index.php?f=bar.pdf, the
users save as... box wants to save the file 'index.php'

when you link to http://www.foo.com/download/bar.pdf and use some simple
rewrite rules to internally rewrite /download/bar.pdf to
/download/index.php?f=bar.pdf, the save as... box of the user wants to
save the file as 'bar.pdf'

Hans

--
"He who asks a question is a fool for five minutes;
he who does not ask a question remains a fool forever"

 

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

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