Welcome Guest, Not a member yet? Register   Sign In
Upload class error-handling
#1

[eluser]Unknown[/eluser]
Hello everyone
I have my own system of error-codes which I return in json format to the client side.
There is display_errors method in upload class, which keeps strings with errors translated in my language.
But I want to handle them, for example something like this:

Code:
$error = $this->upload->getError();
switch ($error) {
case 'filesize': $my_error_code =  15; break;
....
}
....
echo json_encode('errorcode' => $my_error_code);
and then client decides how to display the error.

Is it possibile? I dont want to change system upload class, or make my own

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB