CodeIgniter类multiupload中的致命错误

i have a error to use of multiupload with CodeIgniter:
this is error:

Fatal error: Call to protected method CI_Upload::_prep_filename() from context 'Multi_upload' in D:\xampp\htdocs\CodeIgniter_2.0.0\application\libraries\Multi_upload.php on line 91

and line 91 in multi_upload.php:

// Set the uploaded data as class variables
    $CI->upload->file_temp = $_FILES[$field]['tmp_name'][$i];        
    $CI->upload->file_name = $CI->upload->_prep_filename($_FILES[$field]['name'][$i]); // this is line 91
    $CI->upload->file_size = $_FILES[$field]['size'][$i];        
    $CI->upload->file_type = preg_replace("/^(.+?);.*$/", "\\1", $_FILES[$field]['type'][$i]);
    $CI->upload->file_type = strtolower($CI->upload->file_type);
    $CI->upload->file_ext  = $CI->upload->get_extension($_FILES[$field]['name'][$i]);

Well, you are trying to call the _prep_filename() method, which is protected, from outside the class it's declared in.

protected means you cannot call a method from outside the class it's declared (or one of its child-classes).

So, basically, the Fatal Error is expected behavior -- and the solution is to not call that protected method.


About that, you should read the Visibility section of the manual.