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

[eluser]mikedfunk[/eluser]
In the Form Validation class I can do this:

Code:
$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.
#2

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


Code:
<?php

class MY_Upload extends CI_Upload {

    function getErrorsArray()
    {
        return $this->error_msg;
    }




Theme © iAndrew 2016 - Forum software by © MyBB