Reputation: 24793
I would like to hash the contents of an uploaded file in MD5. The file will not be saved locally so it only exists in a tmp directory.
How can I do this? Thanks.
Upvotes: 10
Views: 13362
Reputation: 23120
You can use md5_file()
or sha1_file()
function. For example, if your post variable is filevar
:
$myhash = md5_file($_FILES['filevar']['tmp_name']);
Upvotes: 21