|
这是我的代码//添加课件
public function addMovieOk()
{
$config['upload_path'] = './upload/movie/'; //上传文件到什么目录中
$config['allowed_types'] = 'flv';
$config['max_size'] = '1000000';
$config['file_name'] = date('YmdHis');
$this->load->library('upload', $config);
$fullName=$_FILES["sources"]['name'];
$ext=explode('.',$fullName);
$url='./upload/movie/'.$config['file_name'].'.flv';
// var_dump($this->upload->do_upload('sources'));
// exit();
if($this->upload->do_upload('sources'))
{
$data = array(
'c_id' => $_POST['c_id'],
'moviename' => $this->input->post('sourcename'),
'intro' => $_POST['content'],
'author' => $this->session->userdata('username'),
'url' => $url,
'dateline' => time(),
);
$this->db->insert('ed_movie', $data);
$this->db->Get_admin_msg("movieManage","添加成功");
}else{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
}为什么上传flv的文件总是报错说文件的类型是不允许的,上传失败?
|
|