My CodeIgniter version is 3.1.2.
Autoload.php -> nothing added to autoload. When trying to upload I am getting HTTP 500.
Can anybody suggest a solution?
public function UploadProfileimage() {
try {
$this->load->helper(array('form', 'url'));
$this->load->library('upload');
$profileimagefolder = 'C:' . DIRECTORY_SEPARATOR . 'xampp' . DIRECTORY_SEPARATOR . 'htdocs' . DIRECTORY_SEPARATOR . 'jalpp';
if (!is_dir($profileimagefolder)) {
mkdir($profileimagefolder, 0777, TRUE);
}
$config['upload_path'] = $profileimagefolder . DIRECTORY_SEPARATOR;
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 100;
$config['max_width'] = 1024;
$config['max_height'] = 768;
$this->upload->initialize($config);
if (!$this->upload->do_upload('profileimage')) {
printv($this->upload->display_errors());
} else {
$data = array('upload_data' => $this->upload->data());
$this->load->view('upload_success', $data);
}
} catch (Exception $e) {
//printv($e);
echo ($e->getMessage());
}
}
output:
