I successfully uploaded the image into the folder and its name to the database but same code does not upload the file in the folder but uploads the name in the database.Following is my code to upload the audio file to my folder musics.
Controller Function
public function add_audio(){
$config['upload_path'] = './musics/';
$config['allowed_types'] = 'mp3';
$config['max_size'] = '100000000000000';
$this->load->library('upload',$config);
chmod('musics/', 0777);
$this->upload->do_upload('output');
$data['audio'] = $_FILES['output']['name'];
$this->load->model('main');
$query = $this->main->insert('audio',$data);
if($query = TRUE){
$this->load->view('admin/success');
}
else{
redirect($_SERVER['HTTP_REFERER']);
} //end else
} //end function