<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 7  文章 - 3  trackbacks - 0
    <2013年5月>
    2829301234
    567891011
    12131415161718
    19202122232425
    2627282930311
    2345678

    常用鏈接

    留言簿

    隨筆檔案

    文章分類

    文章檔案

    搜索

    •  

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜


    多文件上傳 jquery的插件
    使用的方法  導(dǎo)入 jquery.js 及 jquery.MultiFile.js ,
    方式一: 后臺(tái)是文件數(shù)組  
     private File[] upload; // 與jsp表單中的名稱對(duì)應(yīng)
     private String[] uploadFileName;
     private String[] uploadContentType;
    在 form 中加入 <input type="file" name="upload[]" class="multi" /> 即可。

    方式二:后臺(tái)是List<File>
     private List<File> upload; // 與jsp表單中的名稱對(duì)應(yīng)
     private List<String> uploadFileName;
     private List<String> uploadContentType;

    jquery.MultiFile.js  將選中的文件列在From中,名字為upload的<input>,所以要用 name="upload[]"(方法一)或者name="upload" (方法二) 來(lái)接收
    class="multi" 是 jQuery 用來(lái)作的文件類型,HTML 部份代碼如下:

    <head>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
    <title>Untitled Document</title>
    <script src="/multiple-file-upload/jquery.js" type="text/javascript" language="javascript"></script>
    <script src="/multiple-file-upload/jquery.MultiFile.js" type="text/javascript" language="javascript"></script>

    </head>
    <body>

    <form enctype="multipart/form-data" action="<?php $_SERVER['PHP_SELF'] ?>" method="POST">
    <input type="file" name="upload[]" class="multi" maxlength="2"/>
    //<input type="file" name="upload" class="multi" />

    <input type="submit" value="Upload File" />
    </form>

    </body>

    參數(shù)說(shuō)明:

    參數(shù) 說(shuō)明 說(shuō)明
    class="multi" maxlength="2" Limit: 2 files.
    Allowed extensions: any.
    限制數(shù)量2
    class="multi" accept="gif|jpg" Limit: no limit.
    Allowed extensions: gif and jpg.
    格式只能 gif  jpg
    class="multi" accept="gif|jpg" maxlength="3" Limit: 3 files
    Allowed extensions: gif, jpg.
    限制數(shù)量3,格式只能 gif  jpg


    主頁(yè):http://www.fyneworks.com/jquery/multiple-file-upload/

    下載:http://www.fyneworks.com/jquery/multiple-file-upload/#tab-Download

    示例:http://www.fyneworks.com/jquery/multiple-file-upload/#tab-Examples

    posted on 2013-05-17 15:56 Tomas 閱讀(4185) 評(píng)論(2)  編輯  收藏

    FeedBack:
    # re: 多文件上傳 2013-05-19 09:23 11
    01.Ext.getCmp('collect_task_form').getForm().load({
    02. url: "./collectTaskView.do"
    03. ,params: {
    04. id: id
    05. }
    06. ,success: function(form, action){
    07. //Ext.example.msg('編輯', '載入成功!');
    08. //alert(Ext.getCmp("data").getValue());
    09. var o = Ext.util.JSON.decode(action.response.responseText);
    10. if (o) {
    11. var root = o.root;
    12. var pack = root[0];
    13.
    14. alert(pack.displayName);
    15. }
    16. }
    17. ,failure: function(form, action){
    18. Ext.MessageBox.show({
    19. title: '錯(cuò)誤',
    20. msg: '出現(xiàn)異常創(chuàng)建失敗,請(qǐng)與管理員聯(lián)系.',
    21. buttons: Ext.MessageBox.OK,
    22. icon: Ext.MessageBox.ERROR
    23. });
    24. }
    25. ,waitMsg: "正在加載數(shù)據(jù),請(qǐng)稍候..."
    26. });
      回復(fù)  更多評(píng)論
      
    # re: 多文件上傳 2013-05-19 09:23 11
    Formpanel中必須有
    reader: new Ext.data.JsonReader({root:'root'},
    [{name: 'pack',mapping:'pack',type:'string'}
    ])
      回復(fù)  更多評(píng)論
      

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 国产免费播放一区二区| 亚洲黑人嫩小videos| 亚洲av乱码一区二区三区按摩| 久久亚洲精品无码观看不卡| 亚洲精品亚洲人成在线| 精品一卡2卡三卡4卡免费视频| 亚洲中文字幕无码专区| A国产一区二区免费入口| 亚洲综合色视频在线观看| xxxxx做受大片视频免费| 国产av无码专区亚洲国产精品| 久久久受www免费人成| 亚洲精品国产美女久久久| 国产亚洲欧美在线观看| 国产一级做a爱免费视频| 窝窝影视午夜看片免费| 久久久久噜噜噜亚洲熟女综合| 久久高潮一级毛片免费| 亚洲成色999久久网站| 中文毛片无遮挡高潮免费| 亚洲欧美日韩国产成人| 亚洲va中文字幕无码| 99精品全国免费观看视频..| 亚洲精品在线观看视频| 最新猫咪www免费人成| 阿v免费在线观看| 国产高清在线精品免费软件| 处破女第一次亚洲18分钟| 亚洲区小说区图片区QVOD| 国产精品爱啪在线线免费观看| 亚洲av永久中文无码精品| 亚洲色WWW成人永久网址| 成年人网站免费视频| 日本中文字幕免费看| 久久久久久亚洲av成人无码国产| 中文毛片无遮挡高潮免费| 久久精品国产亚洲av天美18| 亚洲成a人片在线观看无码 | 成人毛片免费观看视频在线| 免费国产黄网站在线看| 亚洲男人第一av网站|