Re: asking comment
| From: | Richard Lynch | Date: | Wed, 06 Apr 2005 05:26:32 +0000 |
| Subject: | Re: asking comment | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-212359@lists.php.net to get a copy of this message | ||
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