I have been sitting here for the past two hours trying to make PHP "NOT" corrupt any sort of file upload through a form.
Enctype is set correctly, it saves a file on the server /tmp location, and it even copies the file from there to the new location to keep it past script execution.
The problem is... its getting seriously corrupt somewhere in there.
Simple script:
Upload an image, either .gif or .jpg.
copy() the tmp file to new location.
If I try to run a getimagesize() function on it, it returns nothing. If I try to ownload the file it has on the server, it wont open in anything I have. The original file on my machine will open in any graphic program I have. So the original is ok... but the one getting saved on the server is hosed beyond recognition.
Anyone have any idea why PHP would be doing this?
Server:
Linux YDL2.1
Apache
PHP4+