图片上传功能

qq_55318079 41 0 ZIP 2018-12-27 09:12:01

上传,批量上传功能,PHP //相片批量处理 public function photosAll(){ //p($_FILES); import("ORG.Net.UploadFile"); $upload = new UploadFile(); //设置需要生成缩略图,仅对图像文件有效 $upload->thumb = true; //设置需要生成缩略图的文件后缀 $upload->thumbPrefix = 'm_,s_'; //生产2张缩略图 //设置缩略图最大宽度 $upload->thumbMaxWidth = '200,50'; //设置缩略图最大高度 $upload->thumbMaxHeight = '200,50'; $upload->maxSize = 33292200 ; //设置附件上传大小 $upload->autoSub = true; $upload->subType = 'date'; $upload->dateFormat = 'Ym'; $upload-&g t;allowExts = array('jpg', 'gif', 'png', 'jpeg'); //设置附件上传类型 $upload->thumbRemoveOrigin = false; //是否删除原图,相册会查看高清图所以原图不能删 $upload->savePath = './Upload/Photos/'; //设置附件上传目录 foreach ($_FILES as $key=>$file){ if(!empty($file['name'])) { $info = $upload->uploadOne($file); t;allowExts = array('jpg', 'gif', 'png', 'jpeg'); //设置附件上传类型 $upload->thumbRemoveOrigin = false; //是否删除原图,相册会查看高清图所以原图不能删 $upload->savePath = './Upload/Photos/'; //设置附件上传目录 foreach ($_FILES as $key=>$file){ if(!empty($file['name'])) { $info = $upload->uploadOne($file);

用户评论
请输入评论内容
评分:
暂无评论