多文件上传
来源:互联网 发布:青岛海关数据分中心 编辑:程序博客网 时间:2024/06/07 02:29
1.页面 html 代码
图片:<input type="file" name="image[]">
视频:<input type="file" name="video[]">
视频:<input type="file" name="video[]">
2.module 代码
protected $info= '';
protected $_auto = array(
array('image','upload',3,callback),//自动完成方法
array('video','videoupload',3,callback), //自动完成方法
);//自动填充上传图片生成缩略图
protected function upload(){
$var = $_FILES['image']['name'];
import('ORG.Net.UploadFile');
$upload = new UploadFile();
$upload->saveRule = time;
$upload->allowExts = array('jpg', 'gif', 'png', 'zip','flv');
$upload->thumb = true;
//视频路径。。。只支持flv后缀,
$upload->videopath = './Public/upload/Video/';
$upload->savePath = './Public/upload/images/';
$upload->thumbPrefix = '250_115_,150_110_,213_156_';
$upload->thumbMaxWidth='250,150,213';
$upload->thumbMaxHeight='115,110,156';
if(!in_array('',$var) || !in_array('',$_FILES['video']['name'])){
if(!$upload->upload()) {
echo $upload->getErrorMsg();die;
}else{
$this->info = $upload->getUploadFileInfo();
if(!in_array('',$var) && !in_array('',$_FILES['video']['name'])){
return $this->info[1]['savename'];
}elseif(!in_array('',$var)){
return $this->info[0]['savename'];
}else{
return false;
}
}else{
return flase;
}
}
//上传视频
protected function videoupload(){
if(!in_array('',$var) && !in_array('',$_FILES['video']['name'])){
return $this->info[0]['savename'];
}elseif(!in_array('',$_FILES['video']['name'])){
return $this->info[1]['savename'];
}else{
return false;
}
}
0 0
- 文件上传(多文件)
- asp.net文件上传,多文件上传。
- 单文件上传、多文件上传
- struts2文件上传与多文件上传
- 单文件上传和多文件上传
- PHP文件上传功能 -- 多文件上传
- struts2文件上传(多文件上传)
- SpringMVC文件上传 多文件上传实例
- Struts2之文件上传,多文件上传
- SpringMVC文件上传 多文件上传实例
- 文件上传及多文件上传
- Spring boot 文件上传(多文件上传)
- Struts文件上传--2.多文件上传
- spring boot文件上传【多文件上传】
- FastDFS上传文件二 : 多文件上传
- 多文件上传
- 单/多文件上传
- 多个文件上传
- 中序线索二叉树(Java)
- 上传 mp3,mp4文件
- 将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。 类似于图中效果
- SAM数据格式学习2之FLAG理解
- iOS中tabbar标题设置和导航条标题冲突的问题
- 多文件上传
- Android 体系架构图片
- android 夜间模式的实现
- C#—窗体的基本操作(实验8-3)LinkLabel
- Android 属性文件build.prop,获取属性以及设置属性
- 2.类型和变量
- java实体类实现序列化的意义
- 查看LINUX当前目录下的文件夹大小
- Eclipse Tomcat插件 maven插件 配置运行