ci 框架,视频上传的问题

WBOY
Release: 2016-06-23 13:49:08
Original
1204 people have browsed it

新学习ci框架,很多都不清楚,最近做一个文件上传的功能,遇到了些困难

 //$id是本条文章的id号,意思是每个文件夹只能存放50条视频 public function addmove($id){     $uid = $this->session->userdata('id');     $a=(int)($id/50);     $up_file_path=FILEPATH.'movies/'.$a;     if(is_dir($up_file_path)){         $up_file_path=$up_file_path;     }     else {         mkdir($up_file_path,0777);     }     $config['upload_path'] = $up_file_path;        $config['allowed_types'] = 'mp4|avi';        $config['max_size'] = '1000000';        $this->load->library('upload', $config);        $this->upload->do_upload("fileurl");        if(!$this->upload->do_upload('fileurl'))        {            $error = array('error' => $this->upload->display_errors());        }        $data =  $this->upload->data();        $strlen=strlen(FILEPATH);        $movepath=substr($data['full_path'],$strlen);        $data1 = array(            'fileurl' => '/media/'.$movepath,            'file_name' => $data['raw_name']        );        $this->db->where('id', $id);        $this->db->update('content', $data1); }  
Copy after login

问题:
1、文件不多,我存放的目录应该没有问题吧?
2、windows可以下载此目录视频文件,linux上不能下载,提示404错误(文件找不到);
3、这段程序是并没有将视频上传到相应的文件夹中,不知道哪儿出现了问题。

求解,谢谢。


回复讨论(解决方案)

2、windows可以下载此目录视频文件,linux上不能下载,提示404错误(文件找不到);
存放的目录是  /media/movies/1/我爱你.mp4

自己搞定,增加config.php里的mime类型。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template