Dupe file check using MD5?

From: Date: Thu, 27 Jul 2000 07:07:13 +0000
Subject: Dupe file check using MD5?
Groups: php.general 
Request: Send a blank email to php-general+get-8488@lists.php.net to get a copy of this message
I have an upload script. I would like to compare a file uploaded with a data base entry for dupes. I thought I could use the md5 function to generate a hash of each file and enter it in a database but the md5 function takes a variable not a file. Any ideas how a md5 hash can be generated on a uploaded fle. Files could be gifs,zips or doc files or many others including text files so it has to be binary safe and text safe. How safe is this for comparing for dupes and anyone have stats on the chance it would have the same hash for a non dupe. On a off topic idea. Anyone know if there is a javascript way to read a file on the client side and generate a MD5 hash. I could then pass it in a hidden field before the upload. Saving the upload time if its already on the server. Thanks ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

« previous php.general (#8488) next »