上传文件夹中的mp3文件?
Upload the mp3 file in the folder?
我想上传 mp3 文件,但它显示消息:
"The uploaded file exceeds the maximum allowed size in your PHP configuration file."
我的文件只有 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
需要帮助...
您需要在 php.ini 中增加 upload_max_filesize
和 post_max_size
。更改后,重新启动 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
我想上传 mp3 文件,但它显示消息:
"The uploaded file exceeds the maximum allowed size in your PHP configuration file."
我的文件只有 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
需要帮助...
您需要在 php.ini 中增加 upload_max_filesize
和 post_max_size
。更改后,重新启动 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