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

thinkphp 整合 uploadify 图片上传

WBOY
Release: 2016-06-07 11:43:29
Original
1171 people have browsed it

根据需求配置,多图上传、缩略图、水印(源码附件里下载)
<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元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template