php教程|PHP源码
skymvc文件上传支持多文件上传
php教程-PHP源码
跳至
[1]
[2]
[3]
影音先锋添加信任源码,Ubuntu引导修复报错,命令行启动Tomcat乱码,pathy语言网络爬虫,php获取连接扩展名,图像seo视频lzw
[全屏预览]
smarty->display("upload/default.html");}public function onUpload(){$this->loadClass("upload");//上传的文件目录$this->upload->uploaddir="attach/my/";//允许上传的文件大小$this->upload->maxsize=4194304000;//是否上传图片$this->upload->upimg=true;//设置允许上传的文件类型$this->upload->sysallowtype=array(gif,jpg,mp,png,jpeg, xt,mpeg,avi, m, mvb,wmv,flv,mp3,wav,wma,swf,doc,pdf,zip, ar,svg);$this->upload->allowtype=$this->upload->sysallowtype;//根据Id存储$this->upload->iddir=0;$data=$this->upload->uploadfile("upimg");//print_r($data);echo json_encode($data);}}?>
html5简单网页源码,ubuntu18解压,做爬虫被淘汰,php定义类一定要在文件开头吗,seo类型标题lzw
upload.html
[全屏预览]
{include file="head.html"}{include file="header.html"}
上传文件
上传结果
{include file="footer.html"}.result{border:1px solid #ccc; padding:5px;}.result div{line-height:24px;}.result .e{color:#D58384;}.result .s{color:#59A42A;}$(document).on("change","#upimg",function(data){skyUpload("upimg","/index.php?m=upload&a=upload&ajax=1",function(e){var data=eval("("+e.target.responseText+")");if(data.err){$("#result").append(
error:+data.err+
);}else{$("#result").append(
success:+data.filename+
);}});});
[PHP]代码
跳至
[1]
[2]
[3]
[全屏预览]
function skyUpload(upid,url,success,error,uploadProgress){ var vFD = new FormData(); var f= document.getElementById(upid).files; $("#"+upid+"loading").show(); for(var i=0;i<f.length;i++){ vFD.append(upimg, document.getElementById(upid).files[i]);var oXHR = new XMLHttpRequest(); oXHR.addEventListener(load, success, false);oXHR.addEventListener(error, error, false);if(uploadProgress!=undefined){oXHR.upload.addEventListener("progress", uploadProgress, false);}oXHR.open(POST,url);oXHR.send(vFD); }}/*function uploadFinish(e){var data=eval("("+e.target.responseText+")");$("#uploading").hide()if(data.error != \) { skyToast(data.msg); }else { $("#imgShow").html("");$("#imgurl").val(data.imgurl); }}function uploadError(e) { // upload errorskyToast("上传出错了");}*/
.code_report{float:right}.code_report div{ float: left; margin-left: 5px; background: url(“/img/ask-icon.jpg”) no-repeat; padding: 6px 0 6px 15px; padding-left: 15px; height: 16px;}.code_report a{ background: url(“/img/ask-icon.jpg”) 0 -160px no-repeat;padding-left: 20px; line-height: 15px;height: 16px; color: #333; text-decoration: none; display:inline-block; zoom:1; vertical-align: middle;}.code_report em{ height: 28px; line-height:28px; width: 14px; display: inline-block; float: left; background: url(“/img/ask-icon.jpg”) top right;}