I have facing a problem on codeigniter3 file upload. getting following response
"is currently unable to handle this request.
HTTP ERROR 500"
Not getting any errors. but validation working fine.
anybody can suggest me a solution fr this. Thank you.
following are my code
$this->load->helper('url');
$this->load->library('pagination');
$this->load->model('Video_model');
if($this->input->post('submit')){
$upload_path = './upload/';
$config['upload_path'] = $upload_path;
//allowed file types. * means all types
$config['allowed_types'] = 'wmv|mp4|avi|mov';
//allowed max file size. 0 means unlimited file size
$config['max_size'] = '50000';
//max file name size
$config['max_filename'] = '255';
//whether file name should be encrypted or not
$config['encrypt_name'] = true;
//store video info once uploaded
$video_data = array();
//check for errors
$is_file_error = FALSE;
if (!$_FILES) {
$is_file_error = TRUE;
$this->handle_error('Select a video file.');
}
if (!$is_file_error) {
//load the preferences
$this->load->library('upload', $config);
//check file successfully uploaded. 'video_name' is the name of the input
if (!$this->upload->do_upload('userfile')) {
//if file upload failed then catch the errors
$this->handle_error($this->upload->display_errors());
$is_file_error = TRUE;
} else {
//store the video file info
$video_data = $this->upload->data();
$this->save_video($video_data['file_name']);
}
}