以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  移动端上传照片  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=176073)

--  作者:cd_tdh
--  发布时间:2022/3/29 15:23:00
--  移动端上传照片

老师,请教一下移动端上传照片,哪儿该怎么修改?

我pc端的照片的路径是这样的:/实名制管理/项目名称列的项目名称/姓名列的姓名/身份证.jpg

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:代码.txt


--  作者:有点蓝
--  发布时间:2022/3/29 15:27:00
--  
参考:http://www.foxtable.com/mobilehelp/topics/0060.htm
--  作者:cd_tdh
--  发布时间:2022/3/29 16:06:00
--  

在请教一下老师,身份证扫描件必传,怎么判断不能为空?

        Else
            Dim nms() As String = {"项目名称","劳务队伍单位名称","劳务队伍负责人姓名","姓名","身份证号码","性别","出生日期","年龄","联系电话","家庭地址","卡号","开户银行信息","工种","进场日期","身份证扫描件"} \'不能为空的列名数组
            For Each nm As String In nms
                If e.PostValues.ContainsKey(nm) = False Then \'生成错误提示页
                    With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
                        .icon = "Warn" \'改变图标
                        .AddButton("btn1","返回").Attribute = ""
                    End With
                    e.WriteString(wb.Build)
                    Return \'必须返回
                End If
            Next
            nms = New String() {"项目名称","劳务队伍单位名称","劳务队伍负责人姓名","姓名","身份证号码","性别","出生日期","年龄","联系电话","家庭地址","卡号","开户银行信息","工种","进场日期","身份证扫描件"} \'不能为空的列名数组  \'重新定义了nms数组,增加了两列.
            Dim ds As DataRow = DataTables("实名制管理").AddNew()
            For Each nm As String In nms
                If e.PostValues.ContainsKey(nm) Then
                    ds(nm) = e.PostValues(nm)
                End If
            Next
            For Each key As String In e.Files.Keys
                If key = "up1" Then
                    For Each fln As String In e.Files(key)
                        \'e.SaveFile(key, fln, ProjectPath & "Attachments\\" & fln)
                        e.SaveFile(key, fln, "e:\\实名制管理\\" & ds("项目名称") & "\\" & ds("姓名") & "\\" & fln)
                    Next
                    ds.Lines("身份证照片") = e.Files(key)
                End If
            Next


--  作者:有点蓝
--  发布时间:2022/3/29 16:11:00
--  
            Dim nms() As String = {"项目名称","劳务队伍单位名称","劳务队伍负责人姓名","姓名","身份证号码","性别","出生日期","年龄","联系电话","家庭地址","卡号","开户银行信息","工种","进场日期"} \'不能为空的列名数组
            For Each nm As String In nms
                If e.PostValues.ContainsKey(nm) = False Then \'生成错误提示页
                    With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
                        .icon = "Warn" \'改变图标
                        .AddButton("btn1","返回").Attribute = ""
                    End With
                    e.WriteString(wb.Build)
                    Return \'必须返回
                End If
            Next
if e.Files("up1").count = 0 then
                    With wb.AddMsgPage("","msgpage","增加失败", "身份证扫描件不能为空!")
                        .icon = "Warn" \'改变图标
                        .AddButton("btn1","返回").Attribute = ""
                    End With
                    e.WriteString(wb.Build)
                    Return \'必须返回
end if

--  作者:cd_tdh
--  发布时间:2022/3/29 16:29:00
--  

老师,路径存为这样的路径怎么修改

ds.Lines("身份证扫描件") = e.Files(key)

我这样写不对

ds.Lines("身份证扫描件") = "\\实名制管理\\" & ds("项目名称") & "\\" & ds("姓名") & "\\" & e.Files(key)


--  作者:有点蓝
--  发布时间:2022/3/29 16:32:00
--  

dim lst as  list(of string) = ds.Lines("身份证扫描件")
           For Each key As String In e.Files.Keys
                If key = "up1" Then
                    For Each fln As String In e.Files(key)
                        \'e.SaveFile(key, fln, ProjectPath & "Attachments\\" & fln)
                        e.SaveFile(key, fln, "e:\\实名制管理\\" & ds("项目名称") & "\\" & ds("姓名") & "\\" & fln)
lst .add("\\实名制管理\\" & ds("项目名称") & "\\" & ds("姓名") & "\\" & fln)
                    Next
                    ds.Lines("身份证照片") = lst 
                End If
            Next

--  作者:cd_tdh
--  发布时间:2022/3/29 16:50:00
--  

老师,上传照片处还是有问题,我逐个添加,只会存一个,如果我把Incremental 设为true,保存会报错

            With wb.AddInputGroup("form1","身份证照片","身份证照片")
                With  .AddUploader("up1","身份证照片",True) \'True表示允许上传多个文件
                    \'.AllowDelete = True \'允许删除
                    \'.Incremental = True \'允许重复选择文件或连续拍照
                End With
            End With

 


--  作者:有点蓝
--  发布时间:2022/3/29 16:59:00
--  
这种要调用js提交数据:http://www.foxtable.com/mobilehelp/topics/0106.htm

看帮助尽量看完整,不能断章取义

--  作者:cd_tdh
--  发布时间:2022/3/29 17:23:00
--  
开始我是做的js提交,帮组的这个我也看了,是做的单独的一个页面,就是没转变过来
--  作者:有点蓝
--  发布时间:2022/3/29 17:29:00
--  
单独一个页面还是2个页面,用法都完全一样