NYCPHP Meetup

NYPHP.org

[nycphp-talk] photo album

Adam Fields fields at surgam.net
Thu Dec 26 11:07:06 EST 2002


On Wed, Dec 25, 2002 at 01:26:23AM -0500, billpatterson48 at netscape.net wrote:
> It would be better to keep a max-id in a central location.  Keep
> max-id in its own 1-row table and bump max-id everytime a new
> request comes in for a new-unique-file-name, then incorporate it in
> the file name returned.  The problem with an 8 digit random number
> is that at a very short time you will end up with a collision (the
> odds are not 1 in 10^8 that your system will experience a collision
> but are much less because each file id is competing with each other
> one).

Generated random numbers should be fine if you append them to some
string that corresponds to what the image in.

>From experience, it is not a good idea to take a bunch of images and
rename them to random or sequential numbers - it makes it impossible
for a human to look at a file listing and see what you've got.


-- 
				- Adam

-----
Adam Fields, Managing Partner, fields at surgam.net
Surgam, Inc. is a technology consulting firm with strong background in
delivering scalable and robust enterprise web and IT applications.
http://www.adamfields.com



More information about the talk mailing list