Another workaround

See all posts Reply

Another workaround new!
by Robert, 16 years, 3 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
Re: Another workaround new!
by colin, 16 years, 3 months ago
You code would work, but it is limited only to image files, which is already not that bad. Thanks.Reply