View Full Version : Protected downloads
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?
Are you doing this with the vB member database?
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!
That's not actually protection though, if the URL of the file gets out anyone can download the files.
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>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.