TheMayhem Posted April 25, 2011 Share Posted April 25, 2011 I've been trying to find tutorials/coding today related to controlling the ability to download files. The problem I think I'm having because I know it exists is I don't actually know what it's called. Below is kind of a basis for a tutorial or describing what I'm trying to do. I'm trying to find a tutorial or a how to on storing downloadable files either in a Mysql Database &/or on the file server system. I want to make it so that only users that are stored within the user database who have certain rights or a field can be able to download a file. Those users who don't have the proper permissions in the user table will not be able to and those who do when they go to download a file, will be able to. I know these scripts use PHP but am not really sure where to begin on my search because I don't even know what file permissions coding they are using. Quote Link to comment Share on other sites More sharing options...
Psycho Posted April 25, 2011 Share Posted April 25, 2011 What you are asking about has nothing to do with download functionality. What you are looking for is a method to control functionality based upon permissions. There is no "name" for what you are asking - other than a permission based functionality. Step #1: is to implement a file download functionality. IMPORTANT: you want to store the files in a folder that is not web accessible. When the user requests the file you would read the file and output directly to the browser. Take a look at any download scripts and they *should* have that functionality. STEP #2: Implement a permission check in the download script. A) user requests file, B) Script checks user's permission c) If user has rights continue with the download otherwise display appropriate errors. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.