微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jquery插件uploadify多图上传功能实现代码

本文实例为大家分享了uploadify多图上传具体实现代码,可动态添加上传框,供大家参考,具体内容如下

rush:xhtml;">

<!DOCTYPE HTML>

<Meta http-equiv="Content-Type" content="text/html; charset=utf-8"> UploadiFive Test

Uploadify Demo

<div class='file'>

 <input id="file_upload1" name="file_upload" type="file" multiple="true"&gt;

</div>

<a href="javascript:;" class="clickUpload"> 点击

<script type="text/javascript">

<?php $timestamp = time();?>
$(function() {

var i=2;
$('.clickUpload').click(function(){
var html='';
html+='<div class="file"><input id="file_upload'+i+'" name="file_upload" type="file" multiple="true">

';

$('.form_file').append(html);

 $('#file_upload'+i).uploadify({

  'formData'  : {
   'timestamp' : '<?php echo $timestamp;?>','token'  : '<?php echo md5('unique_salt' . $timestamp);?>'
  },'swf'  : 'uploadify.swf','uploader' : 'uploadify.php','width'   : '120','fileTypeExts': '*.gif; *.jpg; *.png','buttonText': '上传图片','removeCompleted' : false,'multi' : true,//允许多图上传



  //上传成功后执行
  'onUploadSuccess': function (file,data,response) {
   $('#' + file.id).find('.data').html(' 上传完毕');
  }


 });
i++;

})

$('#file_upload1').uploadify({

'formData'  : {
 'timestamp' : '<?php echo $timestamp;?>','token'  : '<?php echo md5('unique_salt' . $timestamp);?>'
},//允许多图上传



//上传成功后执行
'onUploadSuccess': function (file,response) {
 $('#' + file.id).find('.data').html(' 上传完毕');
}

});

});

更多精彩内容,请点击,进行深入学习和研究。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程之家。

原文地址:https://www.jb51.cc/jquery/46618.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐