PDA

View Full Version : Member Only Files


okrogius
24 Dec 2002, 19:02
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 (http://www.vbulletin.org/forum/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
24 Dec 2002, 19:58
Looks good:)

Satan

Mystis
24 Dec 2002, 20:11
Very nice, I'm putting this one up right now!

Sebastian
24 Dec 2002, 20:30
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
25 Dec 2002, 00:06
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
25 Dec 2002, 01:34
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
25 Dec 2002, 02:34
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
25 Dec 2002, 12:12
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
26 Dec 2002, 07:02
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
26 Dec 2002, 14:42
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
26 Dec 2002, 16:27
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
26 Dec 2002, 19:59
I have it working to a point, it does not like pdf files, do I need to zip them up....

okrogius
27 Dec 2002, 03:23
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
14 Apr 2003, 05:16
Doesn't work with PhotoShop PSD files either.

gmarik
09 Jun 2003, 18:27
12-25-02 at 05:06 AM Auero said this in Post #5 (http://www.vbulletin.org/forum/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
02 Oct 2003, 22:38
i get blank files too...

any fix?

urafreak
06 Oct 2003, 19:12
^^

darkmage
07 Oct 2003, 00:32
Excellent, I love it. Now everyone who tries to leech my files won't be able to. :)

They'll have to register. ;)