I know it now. If anybody wants to create similar look to:
/moodle/repository/repisitory_ajax.php
where before this line:
$result = $repo->upload($saveas_filename, $maxbytes);
You can working on $_FILES in temp folder and in:
} catch (Exception $e) {
$err->error = $e->getMessage()
echo json_encode($err);
die;
}
You have a possibility to create error message.
Moodle is awesome
Thanks Tim for Your help. You are very helpfull for me in my topics Thanks one more