Welcome Guest, Not a member yet? Register   Sign In
Flash Image Uploader Issue
#2

[eluser]tomcode[/eluser]
I've built my flash uploader by disabling CI's mime-type check. I extended the upload library by overriding the method is_allowed_filetype().

Code:
/**
* Overrides CI's default, checks no longer
* the mime types, only the file extension.
* I recommend additional checks to compensate.
*
*/
function is_allowed_filetype()
{
    if (count($this->allowed_types) == 0 OR ! is_array($this->allowed_types))
    {
        $this->set_error('upload_no_file_types');
        return FALSE;
    }
        
    foreach ($this->allowed_types as $val)
    {
        if($val == trim($this->file_ext, ".")) return TRUE;
    }

    return FALSE;
}


Messages In This Thread
Flash Image Uploader Issue - by El Forum - 08-16-2009, 12:29 PM
Flash Image Uploader Issue - by El Forum - 08-16-2009, 01:58 PM
Flash Image Uploader Issue - by El Forum - 08-16-2009, 03:20 PM
Flash Image Uploader Issue - by El Forum - 08-16-2009, 03:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB