Avoid file path

6 views
Skip to first unread message

Mayur pimple

unread,
Feb 22, 2012, 12:00:02 AM2/22/12
to php...@googlegroups.com
Hi
In our website video file download using login. but if user can paste URL without login
then file is download.

URL is -> www.abc.com/1.avi
How to avoid access without login.

--

Cheers !!!,

Mayur Pimple
Mobile :
9270367824



 


Akshay Mankar

unread,
Feb 22, 2012, 10:29:22 AM2/22/12
to php...@googlegroups.com
--
On Twitter ==> http://twitter.com/phpcamp
On Facebook ==> http://www.facebook.com/campersfanpage
 
 
 
You received this message because you are subscribed to the Google
Groups "phpcamp" group.
To post to this group, send email to php...@googlegroups.com


First check if user is logged in or not, then use readfile() to allow user to download the file.
You will have to set some http headers for them see the example on http://in3.php.net/manual/en/function.readfile.php.
Also read comments there, they may also be useful.

--
Regards,
Akshay Mankar
The box said "Requires Windows XP, Vista, 7, or better", so I installed Linux.

Reply all
Reply to author
Forward
0 new messages