01-22-2018, 03:55 PM
Hello,
I found some strange thing.
I have two images, but I can only upload one of them.
https://ibb.co/j1U0yb
I can upload 456.jpg,
but I can't upload 123.jpg (it will upload noimage.jpg instead)
This is my controller's code
Anyone have idea?
Thank you very much in advance.
I found some strange thing.
I have two images, but I can only upload one of them.
https://ibb.co/j1U0yb
I can upload 456.jpg,
but I can't upload 123.jpg (it will upload noimage.jpg instead)
This is my controller's code
PHP Code:
$config['upload_path'] = './assets/images/event/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_size'] = '2048';
$config['max_width'] = '1500';
$config['max_height'] = '1500';
$config['remove_spaces'] = FALSE;
$this->load->library('upload', $config);
if(!$this->upload->do_upload('userfile')){
$errors = array('error'=> $this->upload->display_errors());
$post_image = 'noimage.jpg';
}else{
$data = array('upload_data' => $this->upload->data());
$post_image = $_FILES['userfile']['name'];
}
$this->Event->create_events($post_image);
$this->session->set_flashdata('event_created','Your event has been created');
redirect('events');
Thank you very much in advance.