时间:2021-07-01 10:21:17 帮助过:18人阅读
前台html部分:
上传
action执行代码部分:
public function uploadify() { $ph=M('Upload'); import('ORG.Net.UploadFile'); $upload = new UploadFile();// 实例化上传类 $upload->maxSize = 93145728 ;// 设置附件上传大小 $upload->saveRule =rand(1,9999); $upload->allowExts = array('jpg', 'gif', 'png', 'jpeg','flv','avi','mov');// 设置附件上传类型 $upload->savePath = './Uploads/';// 设置附件上传目录 if(!$upload->upload()) {// 上传错误提示错误信息 $this->error($upload->getErrorMsg()); }else{// 上传成功 获取上传文件信息 $info = $upload->getUploadFileInfo(); } for($i=0;$iadd($data); } /*if($rs) { $this->success("成功"); }else { $this->error("失败"); }*/ }
http://www.bkjia.com/PHPjc/824773.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/824773.htmlTechArticle首先,将下载的Uploadify压缩包解压放到公共文件夹内。实现代码如下: 前台html部分: script src="/uploadify/jquery.min.js" data-ke-src="/Public/uploadi...