關於jquery檔案上傳外掛程式 uploadify 3.1的使用

來源:互聯網
上載者:User

標籤:src   ram   size   html標籤   height   load   檔案上傳   href   進度條   

 要使用uplaodify3.1,自然要下載相應的包,http://www.uploadify.com/download/,這裡有兩種包,一個是基於flash,免費的,一個是基於html5,需要付費,我這裡所說的也是前一種。當然現在可能已經不再是3.1版本了,估計是3.2了。不過,差別不會太大!   首先在頁面中引入一下檔案:   <link rel="stylesheet" type="text/css" href="css/uploadify.css">   <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="+currentNode;               alert("上傳完畢");                 }                               });         });          </script>

   屬性解釋:

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

關於jquery檔案上傳外掛程式 uploadify 3.1的使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.