Well, this may be as far as I can take you.
We know that something is happening to the file that corrupts it during the upload or during the transfer from the temporary directory.
This problem is caused by your server, and a Google search confirms that other people have had similar problems with PHP.
Some possible reasons:
1. Your version of PHP is buggy.
2. You are behind a proxy.
From php.faqts
When uploading binary files, some bytes are become corrupted, but file size isnt changing, why?
Jan 27th, 2000 16:39
Manuel Lemos, Nathan Wallace, Michael Berndt, Dmitry Jo
This is a known PHP bug that shows when a client send unexpected
headers in the upload HTTP request. See this report:
http://bugs.php.net/bugs.php3?id=2944
Manuel Lemos
---
The same thing happened to me when trying to do the file upload through
a Proxy. Funnily enough, the Proxy puts his header at the start and
cuts the same amount of bytes from the end of the uploaded file. So the
file size is still correct but the actual data is rubbish. I solved
this Problem when by not using a Proxy (option direct connection to the
internet in your browser).
3. You are using a recoding module with Apache, which is then recoding the binary image data.
From WebMasterWorld:
Your binary files may be uploaded incorrectly if you use modules that recode characters. For example, for Russian Apache, you should use
<Files upload.php>
CharsetDisable On
</Files>
I think this would be in httpd.conf, but I don't use character recoding , so I don't know.
4. Apache's PHP settings are buggy.
Another possibility is an Apache 2.0.40 bug, and the details can be found here:
http://bugs.php.net/bug.php?id=19263You could try uploading a newer version of Apache 2, if this is what you are using.
There may be more possibilities, but these are a good place to start. These were found on the first two pages of a Google search for 'PHP image upload file is corrupted'.