Reply to Re: [PHP] asking comment

Your name:

Reply:


Posted by Frank Arensmeier on 03/30/05 16:22

Instead of generating filenames with random numbers, why not take a
timestamp and use this as filenames?

/frank

2005-03-30 kl. 14.44 skrev William Stokes:

> Hello,
>
> 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.
>
> Is there a so sort of a problem here that I am not thinking of? I only
> can
> imagine problem that the rand() gives the same value twice. But I cant
> see
> this as a major problem because there would be maybe not more than 1000
> uploaded pictures. So the chance is at worst something like 1:10 000
> that
> same name is created to the image.
>
> Anyway if same name is created what's the best way to check that? I was
> thinking of putting the image name field in DB as a unique field. That
> would
> do it? Right?
>
> Thanks again
> -Will
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация