CodeIgniter Forums
Upload library class BUG - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Upload library class BUG (/thread-46976.html)



Upload library class BUG - El Forum - 11-22-2011

[eluser]paulipv[/eluser]

We tested the upload class and seems is not working correct.

When we set allowed file types is NOT working.

The library seems that not set the file_type

Here is the problem i think.
Code:
// Fall back to the deprecated mime_content_type(), if available
     if ( function_exists('mime_content_type') )
     {

      $this->file_type = mime_content_type($file['tmp_name']);
      
      return;
     }

I replaced:
$this->file_type = mime_content_type($file['tmp_name']);
With:
$this->file_type = $file['type'];

and working.

Any fixes?