Foxtable(狐表)用户栏目专家坐堂 → 【weui】移动开发时,如何实现多个文件批量选择上传呢?


  共有4487人关注过本帖平板打印复制链接

主题:【weui】移动开发时,如何实现多个文件批量选择上传呢?

帅哥哟,离线,有人找我吗?
cnsjroom
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1571 积分:11238 威望:0 精华:0 注册:2021/1/17 17:06:00
【weui】移动开发时,如何实现多个文件批量选择上传呢?  发帖心情 Post By:2021/1/22 13:05:00 [只看该作者]

【weui】移动开发时,如何实现多个文件批量选择上传呢?
            

红色部分代码启动后,其他weui内容又全部不在了  只有红色代码部分内容显示【且在手机端无法一次性选择多个文件,在电脑端可以一次性选择多个文件,有没有办法在手机端也可以选择多个文件呢?】

图片点击可在新窗口打开查看此主题相关图片如下:111.png
图片点击可在新窗口打开查看



Dim div As String = FileSys.ReadAllText(ProjectPath & "\qz.txt")
            wb.AddPageTitle("","ph1","记录上传","【三会一课系统】")
            wb.AddForm("","form1","upload.htm")
            With wb.AddInputGroup("form1","ipg1","基础信息")
                
                '前一个"姓名"是ID,后一个"姓名"是标题
                With .AddSelect("单位名称","单位名称","|" & dt.sqlGetComboListString("单位名称"))
                    .Attribute = """
                End With
                With .AddSelect("支部名称","支部名称","")
                    .Attribute = """
                    
                End With
                .AddSelect("会议编号","会议编号","")
                .AddSelect("姓名","姓名","" )
                .AddSelect("图片类别","图片类别","|会议记录|学习记录|学习心得|其它材料")
                
            End With

            Dim sb As New StringBuilder
            sb.appendLine("<form enctype='multipart/form-data' action='accept.htm' method='post' id='form1' name='form1'>")
            sb.appendLine("单文件上传: <input type='file' name='up1' id='up1'><br/><br/>")
            sb.appendLine("多文件上传: <input type='file' name='up2' id='up2' multiple><br/><br/>")
            sb.appendLine("<input Type='submit' name='Sumbit' id='Sumbit' value='确定'>")
            sb.appendLine("</form>")
            e.WriteString(sb.ToString)

            wb.AddTopTips("","toptip1","请输入单位名称和支部名称!")
            With wb.AddInputGroup("form1","ipg2","文件上传") '文件上传
                With.AddUploader("up1","请选择图片",True) 'True表示允许上传多个文件
                .AllowDelete = True '允许删除
                .Incremental = True '允许重复选择文件或连续拍照
                .ScaleWidth = 1024
            End With
        End With
        'End With
        wb.InsertHTML(div)
        With wb.AddButtonGroup("form1","btg1",False)
            
            .Add("btn1", "确定上传", "button").Attribute= "" '调用js函数上传
            .Add("btn2", "取消上传", "submit").FormAction = "default.htm"
            'wb.InsertHTML("<div id='someelement'></div>")
        End With
        With wb.AddDialog("","dlg1", "增加成功","好好学习,天天向上!")
            .AddButton("btnOK","继续增加","default.htm")
        End With
        wb.AddToast("","tst1", "正在上传",1)
        wb.AddToast("","tst2", "上传成功",0)
        wb.AddToast("","tst3", "上传失败",0).Icon= "warn"
        wb.AppendHTML("<script src='./lib/ajaxform.js'></script>") '引入脚本文件
        e.WriteString(wb.Build)


如果取消红色部分代码  代码只能实现一次性选择一个文件进行多次上传,有没有办法实现一次性选择多个文件并一次上传呢?

图片点击可在新窗口打开查看此主题相关图片如下:001.png
图片点击可在新窗口打开查看

 回到顶部
总数 23 1 2 3 下一页