I'm having problems loading the image using the codeigniter download library, I keep getting the error,
The download path is not displayed.
The path to the file I'm trying to download is as follows:
$config['upload_path'] = './media/images/site';
and when I truncate the following,
die(var_dump(is_dir($config['upload_path'])));
I get the following:
BOOL (true)
The folder is also writable (777), so I'm not sure where I am wrong, below is my download code,
$config['upload_path'] = './media/images/site'; //die(realpath($config['upload_path'])); //die(var_dump(is_dir($config['upload_path']))); $config['allowed_types'] = 'gif|jpg|png|jpeg'; $config['max_size'] = '1500'; $config['max_width'] = '390'; $config['max_height'] = '269'; $this->load->library('upload',$config); if ( ! $this->upload->do_upload() && $_FILES['userfile']['error'] != 4) { $data['error'] = $this->upload->display_errors(); $this->template->build('/admin/pages/about_us', $data); } else { $image = $this->upload->data(); if(empty($image['file_name'])) { $image['file_name'] = $this->formbuilder->defaults['page_image']; } $page = array( //'page_title' => $this->input->post('page_title'), //'page_slug' => $this->input->post('page_slug'), 'page_content' => $this->input->post('page_content'), 'page_image' => $image['file_name'], 'date_created' => date("Ymd h:i:s"), 'created_by' => 1 ); if($this->pages_model->insert($this->security->xss_clean($page))) { redirect('/admin/dashboard'); } }
I donβt see anything obvious to stop the file loading, below is my folder structure of my project
/application /system index.php .htaccess /media /images /site /admin /css /js
If someone can shed light on my problem, that would be great.
EDIT FOR A PETIT VNIINER
What can cause this problem?
(The question arises as if it were not obvious enough)