我可以从我的文件上传图像或视频。我已将图像的配置文件设置如下:
$config['upload_path'] = './docs/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '200';
$config['max_width'] = '250';
$config['max_height'] = '250';
$config['file_name'] = md5(rand().time());
$this -> load -> library('upload', $config);
但是当我上传视频时,此配置将不起作用,因为我需要能够上传更大尺寸的文件(视频)。提交后有什么办法可以找出我上传的内容( img/video )并基于此我可以启用配置文件。
视频配置如下:
$configVideo['upload_path'] = './docs/';
$configVideo['max_size'] = '50240';
$configVideo['allowed_types'] = 'avi|flv|wmv|mp3|wma';
$configVideo['overwrite'] = FALSE;
$configVideo['remove_spaces'] = TRUE;
$video_name = $date.$_FILES['video']['name'];
$configVideo['file_name'] = $video_name;
$this->load->library('upload', $configVideo);
$this->upload->initialize($configVideo);