I want to upload the mp3 file but it shows the message of :
"The uploaded file exceeds the maximum allowed size in your PHP configuration file."
my file is only 4.5 mb and this is my controller:
public function add_audio(){
$config['upload_path'] = './musics/';
$config['allowed_types'] = 'mp3|3gp|mpeg';
$config['max_size'] = '999999999999999999999';
$this->load->library('upload',$config);
chmod('musics/', 0777);
$this->upload->do_upload();
$data['audio'] = $_FILES['userfile']['name'];
if ( ! $this->upload->do_upload())
{
$data['error'] = $this->upload->display_errors();
print_r($data['error']);
//line of codes that displays if there are errors
}
else
{
$data['audio'] = $_FILES['userfile']['name'];
$this->load->model('main');
$query = $this->main->insert('audio',$data);
if($query == TRUE){
$this->load->view('admin/success');
}
}
}//end add
need help...
You need to increase upload_max_filesize
and post_max_size
in your php.ini. After change, restart http server to use new values.
; Maximum allowed size for uploaded files.
upload_max_filesize = 5M
; Must be greater than or equal to upload_max_filesize
post_max_size = 5M
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.