Welcome Guest, Not a member yet? Register   Sign In
File Upload class errors array?

In the Form Validation class I can do this:

$errors = $this->form_validation->getErrorsArray();

but that doesn't work in the File Upload class, I get a fatal error. How can I get an array of the errors in the File Upload class? $this->upload->display_errors() is a string and I haven't been able to convert it to JSON because of the key for each error.

Nevermind, I just extended the upload class by adding this in MY_Upload.php in the application->libraries folder:


class MY_Upload extends CI_Upload {

    function getErrorsArray()
        return $this->error_msg;

Theme © iAndrew 2016 - Forum software by © MyBB