Page 1 of 1

Prevent downloading files if session not created

Posted: Sat Jul 21, 2012 10:20 pm
by saifphp
Hi all,

I have an application with php5.4 and ms access2010 database. Visitor can download files from a page only if a session is created. This is managed by session variable.
Now problem is- if any visitor copy the document link an paste into a new explorer window can download that file but I want to prevent downloading file in this way also.

Can anybody guide me how to do this.

Re: Prevent downloading files if session not created

Posted: Sun Jul 22, 2012 12:24 am
by requinix
Make sure the document can be accessed only through a PHP script. That means no redirections: your script actually outputs the file.