public function uploadSong( $ref_id ) { $status = $url = ""; $data['user_info'] = $this->data; if ($status != "error") { $config['upload_path'] = './assets/songs/'; $url = 'assets/songs/'; } $config['allowed_types'] = 'mp3'; $config['max_size'] = 99999; //$config['encrypt_name'] = TRUE; //chmod('assets/', 0777); $this->load->library('upload', $config); if (!$this->upload->do_upload('file_name')) { $status = 'error'; $msg = $this->upload->display_errors('', ''); echo $msg; } else { // Go ahead } }