< /code>
в Controler < /p>
function do_upload()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$config['overwrite'] = TRUE;
$config['encrypt_name'] = FALSE;
$config['remove_spaces'] = TRUE;
if ( ! is_dir($config['upload_path']) ) die("THE UPLOAD DIRECTORY DOES NOT EXIST");
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('userfile')) {
echo 'error';
} else {
return array('upload_data' => $this->upload->data());
}
}
< /code>
И я называю эту функцию, как эта < /p>
$this->data['data'] = $this->do_upload();
< /code>
и просмотреть это изображение: < /p>
- :
Я не знаю, в чем ошибка. < /p>
Подробнее здесь: https://stackoverflow.com/questions/173 ... odeigniter
Мобильная версия