how to prevent the anonymity downloading the ppt files ?

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
phper2000
Forum Newbie
Posts: 1
Joined: Mon Nov 14, 2011 6:36 am

how to prevent the anonymity downloading the ppt files ?

Post by phper2000 »

PHP 5.3, Apache 2.2
The ppt files can be downloaded by our clients,
the ppt links like: http://www.test.com/ppt/example.ppt

before downloading, there is a function to check the clients' authority, even the clients provide the links to the anonymity , however the anonymity could not download either.

how to make it ? thanks a lot!
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: how to prevent the anonymity downloading the ppt files ?

Post by social_experiment »

phper2000 wrote:how to make it
Password protected? User has to login before file can be downloaded
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
maxx99
Forum Contributor
Posts: 142
Joined: Mon Nov 21, 2011 3:40 am

Re: how to prevent the anonymity downloading the ppt files ?

Post by maxx99 »

PHP side:
Use rewrite mod to rewrite URL from:
/ppt/filename.ppt to e.g. /?ppt=filename.ppt
Display password form before downloading, return ppt header later and file content (if pass matches)
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

Apache side:
Use .htaccess to limit user access
http://httpd.apache.org/docs/1.3/howto/htaccess.html <- this one is old you may need to find newer one ;)
Post Reply