首页 技术 正文
技术 2022年11月21日
0 收藏 477 点赞 4,923 浏览 2141 个字
 要使用uplaodify3.1,自然要下载相应的包,下载地址http://www.uploadify.com/download/,这里有两种包,一个是基于flash,免费的,一个是基于html5,需要付费,我这里所说的也是前一种。当然现在可能已经不再是3.1版本了,估计是3.2了。不过,差别不会太大!
   首先在页面中引入一下文件:
   <link rel="stylesheet" type="text/css" href="css/uploadify.css" rel="external nofollow" >
   <script type="text/javascript" src="js/jquery-1.4.4.js"></script>
   <script type="text/javascript" src="js/jquery.uploadify-3.1.js"></script>
   <script type="text/javascript" src="js/jquery.uploadify-3.1.min.js"></script>
    uploadify.swf要和css放在一起,不然会找不到。
   jsp页面里:
     <input type="file" name="uploadify" id="uploadify" value="浏览"/>
    
      <div id="fileQueue" style="border-top: thin solid gray;"></div>
   一下是我自己的页面的代码:
   <script type="text/javascript">
     $('#rightFrame').load(function(){
       var account = $("#account").val();
       var id= $("#userId").val();
       var currentNode=0;
       $("#uploadify").uploadify({
      //注:这里uploadify为html标签,文件输入框id
                    swf: 'css/uploadify.swf',
                    uploader: 'uploadfile.action;',
                    cancelImg: '/images/uploadify-cancel.png',
                    buttonText:'选择文件',
                    fileObjName :'uploadify',
                    auto: true,
                    multi:true,
                    Debug:true,
                    queueID:'fileQueue',//这里fileQueue 为上传进度条显示在哪个div里
                    formData:{'account':account,'id':id,'currentNode':$("#rightFrame").contents().find("#test").val()},
                    removeCompleted:true,
                    queueSizeLimit:999,
                    fileSizeLimit:'100MB',
                    height:28,
                    width:90,
                    successTimeout:28,
                    requeueErrors:true,
                    uploadLimit:5,
                    onUploadSuccess: function (file, data, response) {
                     if(response)
                     {
                      currentNode=data;
                        }
              },
              onQueueComplete : function(stats){
                  window.parent.rightFrame.location.href="fileaction?filenode=" rel="external nofollow" +currentNode;
               alert("上传完毕");
                 }
                  
             });
         });
     
     </script>

属性解释:

http://blog.sina.com.cn/s/blog_6d34781a01018149.html

上一篇: c++ std
下一篇: ROS-SLAM-gmapping
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,488
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,903
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,489
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,290