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
| Posted by: XtraFile on 26 April 2008 11:47pm | |
|
|
its in the file upload class |
| Posted by: XtraFile on 3 May 2008 1:00am | |
|
|
also, i am using flash upload. |
| Posted by: Derek Allard on 6 May 2008 6:16am | |
|
|
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 | |
|
|
SWFUpload v2.0.2 |
| Posted by: Derek Allard on 10 May 2008 9:15am | |
|
|
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. |
