class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
Although the solution seems to be found, i have only read this information after days of frustration on my side. I too found a solution, maybe a bit more generic. The problem, as many of you found, is caused by Flash uploading scripts, not with class.upload. Therefore, I've written the following lines:
$o_file = $_FILES['Filedata']["tmp_name"];
// A std. PHP function for retrieving imageinfo,
// like the MIME type.
$image_info = getImageSize($o_file);
$_FILES["Filedata"]["type"] = $image_info['mime'];
Place this in the file you are posting to with your Flash script. It rewrites one of the parameters of the $_FILES constant that is used by class.upload.
I did not know it was possible to set values of the $_FILES array, but this seems to work for me.
The problem, as many of you found, is caused by Flash uploading scripts, not with class.upload. Therefore, I've written the following lines:
Place this in the file you are posting to with your Flash script. It rewrites one of the parameters of the $_FILES constant that is used by class.upload.
I did not know it was possible to set values of the $_FILES array, but this seems to work for me.
Good luck and thanks for this very useful class.
Robert, The Netherlands