Reply to Another workaround

Another workaround new!
by Robert, 16 years, 9 months ago
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.

Good luck and thanks for this very useful class.

Robert, The NetherlandsReply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important