简体   繁体   English

上传文件夹中的mp3文件?

[英]Upload the mp3 file in the folder?

I want to upload the mp3 file but it shows the message of : 我想上传mp3文件,但它显示以下消息:

"The uploaded file exceeds the maximum allowed size in your PHP configuration file." “上传的文件超出了PHP配置文件中允许的最大大小。”

my file is only 4.5 mb and this is my controller: 我的文件只有4.5 MB,这是我的控制器:

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. 你需要在php.ini中增加upload_max_filesizepost_max_size After change, restart http server to use new values. 更改后,重新启动http服务器以使用新值。

; Maximum allowed size for uploaded files.
upload_max_filesize = 5M

; Must be greater than or equal to upload_max_filesize
post_max_size = 5M

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM