PDA

View Full Version : Protected downloads


John
03-31-2003, 11:50 AM
How can I protect downloads so only members can access certain files? (Without putting the files in a database)

Can it be done with PHP alone?

Brad
03-31-2003, 11:55 AM
Are you doing this with the vB member database?

John
03-31-2003, 11:56 AM
Yep

Brad
03-31-2003, 12:28 PM
Just include global.php in your scripts and add something like this:

if ($bbuserinfo['usergroupid']==0) { // do not allow guest
eval("standarderror(\"".gettemplate('error_nodownload')."\");");
}

and a new custom template that reads

Only members can download files!

John
03-31-2003, 12:37 PM
That's not actually protection though, if the URL of the file gets out anyone can download the files.

Brad
03-31-2003, 12:45 PM
Then i really subjest putting them in a table, and using a script to call the files by id, the files themselfs dont have to be in the db, as long as the link is there and you dont show the users the direct url.

This might help you aswell (if you are storing the files on diskspace): http://www.vbulletin.com/forum/showthread.php?threadid=19021

Sebastian
04-03-2003, 05:02 PM
<a href="https://www.vbulletin.org/hacks/index.php?s=&action=showhack&hackid=830" target="_blank">http://www.vbulletin.org/hacks/index...ack&hackid=830</a>