首頁 >php教程 >php手册 >thinkphp 整合 uploadify 图片上传

thinkphp 整合 uploadify 图片上传

WBOY
WBOY原創
2016-06-07 11:43:291177瀏覽

根据需求配置,多图上传、缩略图、水印(源码附件里下载)
<script><br /> $(function(){<br /> $("#uploadify").uploadify({<br /> &#039;uploader&#039; : &#039;__PUBLIC__/js/uploadify/uploadify.swf&#039;,//所需要的flash文件<br /> &#039;cancelImg&#039; : &#039;__PUBLIC__/js/uploadify/cancel.gif&#039;,//单个取消上传的图片<br /> //&#039;script&#039; : &#039;__PUBLIC__/js/uploadify/uploadify.php&#039;,//实现上传的程序<br /> &#039;script&#039; : &#039;__APP__/Index/upload&#039;,//实现上传的程序<br /> &#039;method&#039; : &#039;get&#039;,<br /> //&#039;folder&#039; : &#039;uploads&#039;,//服务端的上传目录<br /> &#039;auto&#039; : true,//自动上传<br /> &#039;multi&#039; : false,//是否多文件上传<br /> &#039;fileDesc&#039;: &#039;Image(*.jpg;*.gif;*.png)&#039;,//对话框的文件类型描述<br /> &#039;fileExt&#039;: &#039;*.jpg;*.jpeg;*.gif;*.png&#039;,//可上传的文件类型<br /> &#039;sizeLimit&#039;: 2100000,//限制上传文件的大小2m(比特b)<br /> //&#039;simUploadLimit&#039; :3, //并发上传数据 <br /> &#039;queueSizeLimit&#039; :5, //可上传的文件个数<br /> &#039;buttonImg&#039; : &#039;__PUBLIC__/js/uploadify/add.gif&#039;,//替换上传钮扣<br /> &#039;width&#039; : 80,//buttonImg的大小<br /> &#039;height&#039; : 26,<br /> onComplete : function (evt, queueID, fileObj, response, data) {<br /> alert(response);<br /> getResult(response);//获得上传的文件路径<br /> }<br /> });<br /> <br /> var imgg = $("#imgg");<br /> var str = "";<br /> function getResult(content){<br /> str = "<img src=&#039;"+content+"&#039;/ alt="thinkphp 整合 uploadify 图片上传" >"; <br /> imgg.html(str);<br /> }<br /> <br /> });<br /> </script>

附件 code.zip ( 1.63 MB 下载:668 次 )

AD:真正免费,域名+虚机+企业邮箱=0元

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn