Part of the EllisLab Network

Bug Report

Firefox 3.0b5 Image Upload Error

Date: 04/26/2008 Severity: Minor
Status: Not a Bug Reporter: XtraFile
Version: 1.6.1
Keywords:

Description

When uploading an image in FF3b5 the mimetype sent is application/octet-stream, so there is no way for the current upload class to tell if the uploaded file is an image. I have fixed this by switching the is_image function to decide based on file extention.

Code Sample

$config['upload_path'] = './temp/';
$config['allowed_types'] = 'jpg|png|jpeg|gif|zip';
$config['max_size']    = (1024*100);
$this->load->library('upload', $config);

if(
$pass == '_')
{
    $pass
= '';
}

if($desc == '_')
{
    $desc
= '';
}

if($this->upload->do_upload('Filedata'))
{
    $data
= $this->upload->data();
    
$image = $data['is_image'];
    if(
$image)
    
{
        
return true;
    
}
    
return false;
}

Expected Result

return true WHEN image uploaded

Actual Result

is_image = false

Comment on Bug Report

Page 1 of 1 pages
Posted by: XtraFile on 26 April 2008 11:47pm
no avatar

its in the file upload class
I was uploading a file called “DSCN0298.JPG”
-Matt

Posted by: XtraFile on 3 May 2008 1:00am
no avatar

also, i am using flash upload.
-Matt

Posted by: Derek Allard on 6 May 2008 6:16am
Derek Allard's avatar

Hmm… I cannot confirm this, upload works great for me in FF3.  What do you mean by “flash upload”.  Are you referring to swfupload or the like?  If so, could you reduce this to a simple CI only upload and re-try?  Any additional information you can provide would be helpful.  Are you printing errors out?

Posted by: XtraFile on 9 May 2008 5:11pm
no avatar

SWFUpload v2.0.2
You can see an example of it at work here: xtrafile.com/xu2
It seems that it only happens in SWFUpload, and that flash does not correctly send mime types. This has been discussed ad-infinitum in the forums but mimetypes are a very bad way of associating file types. there is a reason we use file extensions.
-Matt

Posted by: Derek Allard on 10 May 2008 9:15am
Derek Allard's avatar

OK, I’m going to close this bug report then, since it isn’t a CodeIgniter bug per se, but rather that mime types aren’t being handled by Flash like you’d expect.  If you want to discuss the merits how CI handles any particular function, the forums are a better place for that as you allude to.

Thanks for taking the time to look into this.

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?