以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- web更新图片问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=176707) |
-- 作者:ycs5801 -- 发布时间:2022/4/23 18:04:00 -- web更新图片问题 Dim e As object = args(0) Dim wb As New weui If e.GetValues.ContainsKey("name") Then Dim name1 As String=e.GetValues("name") wb.AddForm("","form1","Renamecx_name.htm?name1=" & name1) Dim dr As DataRow = DataTables("客户资料").SQLFind("登录用户 = \'赵总\' And _Identify = \'" & e.getvalues("name") & "\'") With wb.AddInputGroup("form1","ipg1","客户信息") .AddInput("客户名称","客户名称","Text").Value = dr("客户名称") .AddInput("手机号","手机号","text").Value = dr("手机号") .AddInput("地域","地域","Text").Value = dr("地域") End With With wb.AddInputGroup("form1","商谈信息","商谈信息") .AddTextArea("商谈记录",10).value = dr("商谈记录") End With With wb.AddInputGroup("form1","图片记录","图片记录") With .AddUploader("up1","",True) .AllowAdd = True .Accept = "image/*" .Incremental=True For Each s As String In dr.Lines("图片") .AddImage("./images/zhaozong/" & s) Next End With End With wb.InsertHTML("<div style=\'height:50px\'></div>") wb.AddPage("","page1").Attribute = "style=\'position: fixed;bottom: 0;right: 0;left: 0\'" \'增加1个page With wb.AddButtonGroup("page1","btg2", False) .Add("btn1", "返回首页", "", "default.htm") .Add("btn2", "重新查询", "", "ReNamecx.htm") End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "保存", "submit") End With Else Dim dr As DataRow = DataTables("客户资料").SQLFind("[_Identify]=" & e.GetValues("name1")) If dr IsNot Nothing Then \'MessageBox.Show(dr("手机号")) \' Dim nms() As String = {"客户名称","手机号","地域","分类","商谈记录"} For Each nm As String In nms dr(nm) = e.PostValues(nm) 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, "d:\\web\\images\\zhaozong\\" & fln) Next dr.Lines("图片") = e.Files(key) End If Next dr.Save() \'显示完成提示,2妙手自动返回原来的页面 wb.AppendHtml("<meta http-equiv=\'refresh\' c>",True) wb.AddToast("","t1", "编辑完成",0).Visible = True Else With wb.AddMsgPage("","msgpage","保存失败", "此信息可能已经被删除!") \'提示用户此订单不存在. .icon= "Warn" .AddButton("btn1","返回","Renamecx_name.htm?name=" & e.GetValues("name1")) \'生成返回原来页面的按钮 End With End If End If e.WriteString(wb.Build) \'生成网页 现在增加图片后,点击保存无法保存新的图片。
[此贴子已经被作者于2022/4/23 19:01:42编辑过]
|
-- 作者:程兴刚 -- 发布时间:2022/4/23 23:57:00 -- 去掉这一行: .Incremental=True 否则改用ajax
|
-- 作者:有点蓝 -- 发布时间:2022/4/24 8:44:00 -- 参考:http://www.foxtable.com/mobilehelp/topics/0106.htm |
-- 作者:ycs5801 -- 发布时间:2022/4/25 11:06:00 -- With wb.AddInputGroup("form2","图片上传","图片上传") With .AddUploader("up128","",True) .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 .AllowAdd = True .Accept = "image/*" \'.Incremental=True For Each s As String In dr.Lines("图片") .AddImage("./Attachments/" & s) Next End With End With For Each key As String In e.Files.Keys If key="up128" Then For Each fln As String In e.Files(key) e.SaveFile(key,fln,ProjectPath & "Attachments\\" & fln) \'保存接收到的文件 \'lst.add(fln) Next dr.lines("图片")=e.files(key) dr.save() End If Next 现在删除图片后,无法保存,就是图片删不掉,接收部分应该怎么改?
|
-- 作者:有点蓝 -- 发布时间:2022/4/25 11:14:00 -- http://www.foxtable.com/mobilehelp/topics/0094.htm |
-- 作者:ycs5801 -- 发布时间:2022/4/25 13:19:00 -- With wb.AddInputGroup("form2","图片上传","图片上传") With .AddUploader("up128","",True) .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 .AllowAdd = True .Accept = "image/*" \'.Incremental=True For Each s As String In dr.Lines("图片") .AddImage("./Attachments/" & s) Next End With End With 它只是读取图片单元格里的文件名 并不是后台文件啊 所以如果这个单元格里的文件名如果已经是删除后的状态,就应该可以显示正确的图片了 |
-- 作者:有点蓝 -- 发布时间:2022/4/25 13:39:00 -- 没看懂想表达什么意思 |
-- 作者:ycs5801 -- 发布时间:2022/4/25 13:50:00 -- Dim e As RequestEventArgs = args(0) Dim wb As New WeUI Dim dr As DataRow = DataTables("客户资料").SQLFind("登录用户 = \'赵总\' And _Identify = \'" & e.getvalues("name") & "\'") If dr IsNot Nothing Then \'\'文字资料上传 Dim nms() As String = {"客户名称","手机号","地域","分类","商谈记录"} For Each nm As String In nms dr(nm) = e.PostValues(nm) Next \'\'图片资料上传 For Each key As String In e.Files.Keys messagebox.show(e.Files(key).Count) messagebox.show(2) If key="up128" Then For Each fln As String In e.Files(key) messagebox.show(3) e.SaveFile(key,fln,ProjectPath & "Attachments\\" & fln) \'保存接收到的文件 \'lst.add(fln) Next dr.lines("图片")=e.files(key) End If Next dr.save() 现在设置的这两个断点,没有任何提示,这些代码是在recevie函数中。
|
-- 作者:有点蓝 -- 发布时间:2022/4/25 13:57:00 -- 如果只是删除文件,没有添加新的文件,肯定不会有提示的。有仔细看5楼的帮助了吗,帮助里是怎么判断有没有删除文件的! |
-- 作者:ycs5801 -- 发布时间:2022/4/25 14:19:00 -- 看了,还是没理解,我现在不是非得删除后台文件,现在是前端一直显示已删除的照片。 |