I build a site that has a login module verified against a mysql dbase.The users after login can upload some files.
How can i protect these files from being viewed and downloaded by people that are not logged in but know the path??
Moderators: macek, egami, gesf

: 






session_start();
if(!isset($_SESSION['authorized']))
$_SESSION['authorized'] = 0;
if(!isset($_SESSION['access_level']))
$_SESSION['access_level'] = 0;
if($_SESSION['authorized']==1 && $_SESSION['access_level'] > 10)
{
//display page
}
else
{
//stuff they see if they are not authorized
}

lacroix13 wrote:AGAIN, YOU DONT UNDERSTAND!!!
This site is a multiuser system.
From the begining:
*how does yahoo keeps email attachements so that only the person it was addressed to can download them???
*if you are not the addressee, you can't access the file even if you know it's full path (ie: http://www.mysite.com/files/prot/file.zip)
I'm asking this because if you type http://www.mysite.com/files/prot/file.zip you may download the file

Return to PHP coding => General
Users browsing this forum: No registered users and 1 guest