Log in

View Full Version : attachment filename as hash


medienleben
05-31-2007, 08:53 PM
hi, i needed to have the attachments on the file system, but this is now a problem cause the filenames are only increased, so if someone wants to download all attachments, hea has only to make donload all attachments from 1 to...
i would need somehow to create the filename as a hash, or random unique, somehow, is it possible?
thx

Wayne Luke
05-31-2007, 10:57 PM
Each attachment already has a 32 digit filehash stored in the database. This is how vBulletin checks for duplicate attachments.

medienleben
06-04-2007, 03:31 PM
Each attachment already has a 32 digit filehash stored in the database. This is how vBulletin checks for duplicate attachments.

no, i mean it like this...
i have path: /var/www/vbulletin/atatchments/

and there are all the attachments stored as: 1/1.attach, 1/2.attach...

and if someone runs wget or any other downloader for 1-n he can download all the attachments, i would need something like:

1/hash.jpg

if this is not done, it is a big security issue for those that have the files stored on fs

Wayne Luke
06-04-2007, 04:09 PM
Store you attachments in /var instead of /var/www/vbulletin/attachments. Or place an .htaccess deny from all in the attachments directory. Then someone won't be able to download them all.

medienleben
06-04-2007, 05:30 PM
Store you attachments in /var instead of /var/www/vbulletin/attachments. Or place an .htaccess deny from all in the attachments directory. Then someone won't be able to download them all.

lol, and how can i use it then on the forum??

Wayne Luke
06-04-2007, 05:55 PM
They are recalled via a PHP file so the browser doesn't access them directly.

medienleben
06-04-2007, 06:47 PM
your right, i ment that they are called directly, thx:)