RE: Re[6]: [PHP] asking comment
How about a filename based upon a user id and the time the file was uploaded. Unless you have multiple instances of the same user then it will not be possible for the same user to upload a file at exactly the same time as himself. Just a thought... Mikey -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: 30 March 2005 19:19 To: php-general@lists.php.net Subject: Re[6]: [PHP] asking comment Hello Jared, Wednesday, March 30, 2005, 7:02:58 PM, you wrote: JW I'll take absolutely bullet-proof and handled/supressed warnings, JW over relatively bullet-proof. That would be fine if your previous solution was absolutely bullet-proof, or for that matter provided a solution for the original problem of renaming uploaded files and keeping them unique. Appending a datetime to a file, or using a loop that hopes you get a unique name within 100 iterations is wildly far from bullet proof in just about every respect. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I do not fear computers. I fear the lack of them. - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[6]: [PHP] asking comment
I agree with this solution, though it only effects the OP if he is using a login system of sorts. Martin Austin Mikey [EMAIL PROTECTED] 03/30/2005 12:39 PM Please respond to frak To: php-general@lists.php.net cc: Subject:RE: Re[6]: [PHP] asking comment How about a filename based upon a user id and the time the file was uploaded. Unless you have multiple instances of the same user then it will not be possible for the same user to upload a file at exactly the same time as himself. Just a thought... Mikey -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: 30 March 2005 19:19 To: php-general@lists.php.net Subject: Re[6]: [PHP] asking comment Hello Jared, Wednesday, March 30, 2005, 7:02:58 PM, you wrote: JW I'll take absolutely bullet-proof and handled/supressed warnings, JW over relatively bullet-proof. That would be fine if your previous solution was absolutely bullet-proof, or for that matter provided a solution for the original problem of renaming uploaded files and keeping them unique. Appending a datetime to a file, or using a loop that hopes you get a unique name within 100 iterations is wildly far from bullet proof in just about every respect. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I do not fear computers. I fear the lack of them. - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[6]: [PHP] asking comment
JW I'll take absolutely bullet-proof and handled/supressed warnings, JW over relatively bullet-proof. That would be fine if your previous solution was absolutely bullet-proof, or for that matter provided a solution for the original problem of renaming uploaded files and keeping them unique. Appending a datetime to a file, or using a loop that hopes you get a unique name within 100 iterations is wildly far from bullet proof in just about every respect. Oh and generating random filenames from md5(), crossing your fingers and hoping you've got a unique filename is better? Or assume that files don't already exist in the directory? You are going against convential wisdom about ensuring unique filenames. Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php