Re: scalable web gallery
| From: | tedd | Date: | Fri, 11 Jul 2008 15:52:53 +0000 |
| Subject: | Re: scalable web gallery | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-276654@lists.php.net to get a copy of this message | ||
At 10:41 AM -0400 7/10/08, Daniel Brown wrote:
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.comStill, 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.