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.
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.
You can use md5_file()
or sha1_file()
function. For example, if your post variable is filevar
:
$myhash = md5_file($_FILES['filevar']['tmp_name']);