以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 录入页面,选择上传图片后,怎么生成crc值呢?怎么在录入成功后,将录入信息页面内容及图片显示出来呢?允许上传多个文件,经过实际测试,只能上传一张图片,且照片一旦选择,为什么不能移除呢? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=141646) |
-- 作者:李孝春 -- 发布时间:2019/10/7 23:20:00 -- 录入页面,选择上传图片后,怎么生成crc值呢?怎么在录入成功后,将录入信息页面内容及图片显示出来呢?允许上传多个文件,经过实际测试,只能上传一张图片,且照片一旦选择,为什么不能移除呢? 表没有加载字段照片、crc值 两个字段属于二进制字段 1、录入页面,选择图片后上传,如何根据字段“照片名”生成字段“crc值”? Dim val As String = CRCCheckFile(dr("照片名")) dr.SQLSetValue("CRC值",val) 这个代码没有起作用 2、录入成功之后,如何获取录入成功后的页面内容,将当前录入保存成功的页面值进行显示? 3、允许上传多个文件,经过实际测试,只能上传一张图片,请问红色部分代码有什么办法修正么?且照片一旦选择,为什么不能移除呢? 页面代码如下: Dim wb As New weui Select Case e.Path Case "xjrjzjf.htm" If e.PostValues.Count = 0 Then wb.AddPageTitle("","ph1","博融现金日记账") wb.AddForm("","form1","xjrjzjf.htm") With wb.AddInputGroup("form1","ipg1","现金日记账【收入记账】") .AddInput("日期","日期","date") .AddSelect("凭证种类","凭证种类","|发票|收据|收条|小票|物流单|快递单|其它单据") .AddInput("凭证号数","凭证号数","Text") .AddSelect("对方科目","科目类别","|日常办公|销售回款|日常开支|货物订货|其它项目") .AddInput("摘要","内容摘要","Text") With .AddInput("借方金额","收入金额","number") .Step = "0.01" .Attribute = "" End With .AddSelect("借方","收入人员","|肖妍|费泓纶|田景兰") .AddUploader("up1","照片",True) \'True表示允许上传多个文件 With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With End With e.WriteString(wb.Build) Else Dim nms() As String = {"日期","凭证种类","凭证号数","摘要","科目类别","日页","借方金额","借方","照片名","crc值"} \' Dim dr As DataRow = DataTables("现金日记账").AddNew() For Each nm As String In nms If e.PostValues.ContainsKey(nm) Then dr(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) Next dr.Lines("照片名") = e.Files(key) End If Next dr.save() Dim val As String = CRCCheckFile(dr("照片名")) dr.SQLSetValue("CRC值",val) With wb.AddMsgPage("","msgpage","增加成功", "好好学习,天天向上") \'生成成功提示页 .AddButton("btn1","继续增加","xjrjzjf.htm") End With e.WriteString(wb.Build) End If End Select
[此贴子已经被作者于2019/10/8 0:12:50编辑过]
|
-- 作者:有点蓝 -- 发布时间:2019/10/8 9:16:00 -- 1、CRCCheckFile需要使用绝对路径,照片列保存的不是绝对路径吧? msgbox(ProjectPath & dr("照片名")) Dim val As String = CRCCheckFile(ProjectPath & dr("照片名")) 2、使用ajax提交数据,页面不刷新即可:http://www.foxtable.com/mobilehelp/topics/0101.htm |
-- 作者:李孝春 -- 发布时间:2019/10/8 16:49:00 -- 回复:(有点蓝)1、CRCCheckFile需要使用绝对路径,照... 麻烦有点蓝老师指导一下: 红色部分代码 启用后 如果有多张照片上传后,怎么给图片名增加多个绝对路劲呢?并且对应增加多个crc值呢? 蓝色部分代码 使用时 会生成两条记录 而实际上只有一条 运行过程中还会提示文件上传失败?多个图片的时候 第一个会上传成功 第二个就不能了 求解 页面代码如下: Dim e As RequestEventArgs = args(0) Dim wb As New weui Select Case e.Path Case "xjrjzjf.htm" If e.PostValues.Count = 0 Then wb.AddPageTitle("","ph1","博融现金日记账") wb.AddForm("","form1","xjrjzjf.htm") With wb.AddInputGroup("form1","ipg1","现金日记账【收入记账】") .AddInput("日期","日期","date") .AddSelect("凭证种类","凭证种类","|发票|收据|收条|小票|物流单|快递单|其它单据") .AddInput("凭证号数","凭证号数","Text") .AddSelect("对方科目","科目类别","|日常办公|销售回款|日常开支|货物订货|其它项目") .AddInput("摘要","内容摘要","Text") With .AddInput("借方金额","收入金额","number") .Step = "0.01" .Attribute = "" End With .AddSelect("借方","收入人员","|肖妍|费泓纶|田景兰") With wb.AddInputGroup("form1","ipg22","文件上传") With .AddUploader("up1","图片",True) .AllowDelete = True \'允许删除 .Incremental = True \'允许 重复选择文件或连续拍照 End With End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit").Attribute= "" \'调用js函数上传 End With End With wb.AddToast("","tst1", "正在上传",1) wb.AddToast("","tst2", "上传成功",0) wb.AddToast("","tst3", "上传失败",0).Icon= "warn" wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>",True) \'引入脚本文件 wb.AppendHTML("<script src=\'./lib/yue.js\'></script>") \'引入脚本文件 e.WriteString(wb.Build) 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() {"日期","凭证种类","凭证号数","摘要","科目类别","日页","借方金额","借方","照片名","crc值"} \'重新定义了nms数组,增加了两列. Dim dr As DataRow = DataTables("现金日记账").AddNew() For Each nm As String In nms If e.PostValues.ContainsKey(nm) Then dr(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) dr("照片名") = ProjectPath & "Attachments\\" & fln Next End If Next \'保存并生成增加成功提示页面 dr.save() Dim val As String = CRCCheckFile(dr("照片名")) dr.SQLSetValue("CRC值",val) e.AsyncExecute = True \'通知系统异步执行,不要关闭信道 Functions.AsyncExecute("jisuan",e) \'异步调用函数处理接收到的数据和文件 With wb.AddMsgPage("","msgpage","增加成功", "好好学习,天天向上") \'生成成功提示页 .AddButton("btn1","继续增加","xjrjzjf.htm") End With e.WriteString(wb.Build) End If End Select [此贴子已经被作者于2019/10/8 17:03:21编辑过]
|
-- 作者:有点蓝 -- 发布时间:2019/10/8 17:06:00 -- 同一个单元格多个文件,是分多行显示的,使用lines获取即可:http://www.foxtable.com/webhelp/topics/2717.htm With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "button").Attribute= "" \'调用js函数上传 End With |
-- 作者:李孝春 -- 发布时间:2019/10/8 17:36:00 -- 回复:(有点蓝)同一个单元格多个文件,是分多行显示... 有点蓝老师 e.SaveFile(key, fln, ProjectPath & "Attachments\\" & fln) dr.Lines("照片名") = e.Files(key) 这样代码提示无问题 e.SaveFile(key, fln, ProjectPath & "Attachments\\" & fln) dr.Lines("照片名") = ProjectPath & "Attachments\\" & fln 这样代码提示不对 有没有办法补正呢? |
-- 作者:有点蓝 -- 发布时间:2019/10/8 17:47:00 -- 把帮助认真看看,Lines是一个集合,不是一个字符串 |