View Full Version : Member Only Files
okrogius
12-23-2002, 10:00 PM
Member Only Files
------------------------------------------------------------------------
What Is This?
There are plenty of hacks which allow you to protect regular php pages to be accessible only to your vb members. But how many hacks do you see that allow you to make your files member only? This one does preceisely that.
How Do I Install It?
Download attached file (download.php). You will need to edit some things on top of the file, fairly self explanatory. Then upload the file to the same folder where your vbulletin is installed. Now you can provide download links to your members such as:
http://www.yoursite.com/forums/download.php?file=members_only_material.zip
Please note that filename can only contain letters, numbers, and underscores.
How Can I Thank You For This Hack?
1. Click the install button (https://vborg.vbsupport.ru/misc.php?action=install&threadid=46963).
2. Go to my forums (http://forums.cgshock.com) and register and activate your account.\
Thanks.
Help! This doesn't work.
If something doesn't work post your problem here and I will try to help you get it working. Any support requests outside of this thread (whether pm, im, email, etc) will be IGNORED.
Enjoy. :)
Chris M
12-24-2002, 06:58 PM
Looks good:)
Satan
Mystis
12-24-2002, 07:11 PM
Very nice, I'm putting this one up right now!
Sebastian
12-24-2002, 07:30 PM
doesn't seem to be working.. when i call a file it downloads a null file. hmm.
what about if you have a directory with your files called files but also have subdirectories with other files. how would you call the files in the sub directory, if at all possible?
Auero
12-24-2002, 11:06 PM
Wow, great hack :D This is exactly the thing I've been looking for tonight. I did try the script found at www.phparena.net but that's a lot of files for one simple task :(
Great work codename
okrogius
12-25-2002, 12:34 AM
Originally posted by Sebastian
doesn't seem to be working.. when i call a file it downloads a null file. hmm.
what about if you have a directory with your files called files but also have subdirectories with other files. how would you call the files in the sub directory, if at all possible?
Doesn't seem to be working - Make sure you changed the path in the configuartion properly and that the file that you're ttempting to download exists.
Directories - It's possible, but you have to keep in mind of some things. For security purposes the filename goes througha r egular expression check, so someone doesn't go to download?file=/etc/passwd or the lik. It is possible to do folders too, but it makes the whole file parameter validation a whole lot more tedious.
Sebastian
12-25-2002, 01:34 AM
nope, i set it to full path.. I tried to download a .php file and it worked.. but when i try to download a .zip, .rar, .exe it downloads a blank null file.. weird.. can anyone verify this? i am running php v4.3.0
Dean C
12-25-2002, 11:12 AM
This is an awesome idea... so much room for expansion too!
I'm referring this to a friend of mine.. he'll have a great use to this hack :p
Thanks and Merry Christmas
- miSt
Lanigironu
12-26-2002, 06:02 AM
I recently wrote something similar myself. Good job.
The only problem I see with this is that it won't take people too long to figure out where the files are coming from. What you should do is have a separate folder for the files, and have it chmoded so only a script can call for it. I'm not sure if such a chmod setting exists though. This way, even if the person knows where to get it, he or she can't without passing through the script.
okrogius
12-26-2002, 01:42 PM
Obviously it shoudl be in a seperate folder. This is exactly hwo this file is written. And that folder should be in a non-webaccessible location as illustrated by the example url. ;)
Lanigironu
12-26-2002, 03:27 PM
Well you said to, "Upload the file to where the vbulletin is installed," and I thought you meant the download files. Sorry, it was a bit late when I read it.
USODJA
12-26-2002, 06:59 PM
I have it working to a point, it does not like pdf files, do I need to zip them up....
okrogius
12-27-2002, 02:23 AM
The download.php should be placed in your vb folder (can be placed elsewhere, but then you would need to change the require('./global.php'); line a bit). The actual download material files should be placed in a non web accessible location; and that location is specified on top of the download.php file.
Hmm, pdf files... sorry i can't really think of much. It could be something with web server configuration, could be just how PDF files are made - most likely the former though. If someone can confirm that, it would be nice. For the time being it might be a good idea to just zip them (the file will provide a download box either way and not show it in the browser, so might as well cut down the download size a bit).
Katman
04-14-2003, 04:16 AM
Doesn't work with PhotoShop PSD files either.
gmarik
06-09-2003, 05:27 PM
12-25-02 at 05:06 AM Auero said this in Post #5 (https://vborg.vbsupport.ru/showthread.php?postid=334597#post334597)
www.phparena.net but that's a lot of files for one simple task :(
Maybe we could integrate it?
urafreak
10-02-2003, 09:38 PM
i get blank files too...
any fix?
urafreak
10-06-2003, 06:12 PM
^^
darkmage
10-06-2003, 11:32 PM
Excellent, I love it. Now everyone who tries to leech my files won't be able to. :)
They'll have to register. ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.