0

I am uploading a file using PHP which uses md5_hash to create a MD5 hash of the file.

When I upload that same file to other online MD5 hash generators they return something else.

Is there something I am doing wrong?

$MD5 = md5_file($_FILES['inputname']['tmp_name']);
var_dump($MD5);

string(32) "d41d8cd98f00b204e9800998ecf8427e"

https://md5file.com/calculator says:

MD5 3be70563560066c0751a8e9427949bbf
JonathanBristow
  • 1,066
  • 2
  • 13
  • 36

1 Answers1

0

d41d8cd98f00b204e9800998ecf8427e is the MD5-hash of the empty string. This means that the file that the filename $_FILES['inputname']['tmp_name'] points to is empty.

So, there is a major problem with the upload somewhere... maybe a server configuration error. It's impossible to say though, without further investigations.

Michael
  • 6,451
  • 5
  • 31
  • 53
  • You are correct. There was an issue with the PHP configuration which was clearing the cache before I could get to the posted file. – JonathanBristow May 29 '14 at 20:20