Since it is necessary to determine whether the uploaded file has been modified, it is necessary to record the md5 value of the uploaded file, so let’s talk about it here Method to get the md5 value of a file.
md5_file()
The md5_file() function calculates the MD5 hash of a file. The md5() function uses RSA data security, including the MD5 message digest algorithm. Returns the calculated MD5 hash on success, false on failure.
Syntax: md5(string,raw)
§Parameterstring, required, specifies the file to be calculated.
§Parametercharlist, optional. Specifies hexadecimal or binary output format: TRUE - raw 16-character binary format; FALSE - default. 32-character hexadecimal number.
Store the MD5 hash of the "test.doc" file:
Now we will detect if "test.doc" has been changed (i.e. if the MD5 hash has been changed):
The end.
PHP gets the md5 of the file and checks whether it has been modified. Since it needs to determine whether the uploaded file has been modified, it needs to be recorded The md5 value of the uploaded file, so let’s talk about getting the file md...