back to notes

codeigniter upload bug

allowed_types prevent uploading of non-image files sometimes Date:02/15/2009Severity:MinorStatus:NewReporter:pistolPeteVersion:1.7.2 SVNKeywords:Libraries, File Uploading ClassForum Thread: http://codeigniter.com/forums/viewthread/105777/DescriptionIf “allowed_types” contains image types as well non image types, it’s not possible to upload a non image file because of a bug in line 567.

FIX

if ($this->is_image && in_array($val, $image_types))
{
if (getimagesize($this->file_temp) === FALSE)
{
return FALSE;
}
}


last updated october 2010