A.J. Brown:
A better solution is to rename the image to the unique ID of the news
article it's associated with (assuming there is only one image allowed per
article).  This helps eliminate the chances of overwriting an existing image
without bothering the user with error messages.  When I do this, I usually
use the md5sum of the unique ID instead of the actual number.  For example:

$image_name = md5($article_id) . ".jpg";

is there a reason for this md5 approach? As you don't add any information,
the news id is probably in the querystring anyway, how does it improve

I'm in the middle of writing an article about piecing together an imagebank
prototype, and I've found so far that most people would like to add extra
information, and store the image not connected to news or any listed
articles. Like this, they can be reused, without uploading them again. A
good filename approach is something still to do. Does it really matter, if
the filename is something identifiable? Is it not even nicer if it was
'image_title_'.$id.'.jpg'? more readable than a checksum?


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to