Re: scalable web gallery

From: Date: Sat, 12 Jul 2008 00:51:22 +0000
Subject: Re: scalable web gallery
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-276677@lists.php.net to get a copy of this message
> Why not use a hash table based upon the name of the file and distribute files that way? sorry tedd, i don't really get it. but i am interested to know more about the hash table concept. can you explain a little bit more.. thanks.. On 7/11/08, tedd <tedd.sperling@gmail.com> wrote: > At 10:41 AM -0400 7/10/08, Daniel Brown wrote: >> Still, I'd create 16 subdirectories under the images directory: >>0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f. Then name the file as an MD5 hash of >>the image uploaded, and place it in the directory matching the first >>character of the new file name. > > Why not use a hash table based upon the name of the file and > distribute files that way? > > You don't even need a directory until you actually need one -- then > create one 'on-the-fly' and drop the file into it. > > As such, it's easy to find the file again by simply hashing it's name > -- you don't even need to store a path for the file, only the name of > the file. > > Cheers, > > tedd > > -- > ------- > http://sperling.com > http://ancientstones.com > http://earthstones.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#276677) next »