列出的其他文件正在上传,但swf文件没有上传,不支持文件类型错误。
这是我的控制器
function do_upload(){
$pid=$this->input->post('Page_id');
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'swf|png|gif|jpg';
$config['max_size'] = '1048';
$config['file_name'] =$pid;
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('admin/upload', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
$this->upload_success();
}
}
答案 0 :(得分:0)
可能是_file_mime_type函数中的文件上载类的错误
look for more
here
答案 1 :(得分:0)
您尚未在do_upload
调用中传递字段名称,如
$config = array(
'allowed_types' => 'jpg|jpeg|swf|png', // pipe seperated file types
'upload_path' => './uploads/',// should be the root path
'max_size' => '1048',
'file_name' =>$pid
);
$this->load->library('upload', $config );
if (!$this->upload->do_upload('your_field_name')){
// like $this->upload->do_upload($pid)
$error = array('error' => $this->upload->display_errors());
}else{
$swf_data = $this->upload->data();
}
希望它有意义