|
Posted by Richard Lynch on 04/06/05 08:26
On Wed, March 30, 2005 5:44 am, William Stokes said:
> I got a bit frustrated with image upload stuff with different image name
> problems. So I created a system that gives the uploaded imaged a random
> numeric name between 1-10 000 000 and saves the file to a server folder
> and
> the image name to mysql DB.
Given the sort of race conditions and problems brought up here, it occurs
to me that *MAYBE* http://php.net/mkdir would help, as I believe it's
atomic, and will either succeed or fail.
You are then creating a unique directory name for each image, and you put
the image inside that directory.
That may be even more problematic than using the SQL, however...
Still, worth pondering, I think.
--
Like Music?
http://l-i-e.com/artists.htm
[Back to original message]
|