Just before submitting the form a JS code can calculate the MD5 of the file such that the server can check the integrity of the file.