以文本方式查看主题 - 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=169833) |
-- 作者:ljh29206 -- 发布时间:2021/7/2 16:48:00 -- web 文件上传 查了很久没查到原因 Dim e As RequestEventArgs = args(0) Dim wb As New weui wb.AddPageTitle("","pageheader","12345") Dim PageURL = "fp.htm" If e.PostValues.Count = 0 Then \'生成编辑页面 wb.AddForm("","form1","addfplist.htm") With wb.AddInputGroup("form1","ipg1","") .AddInput("日期","日期","date") .AddInput("编号1","编号1","text") .AddInput("名称1","名称1","text") With .AddUploader("up128","图片",True) .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 .ScaleWidth = 400 \'自动压缩图片宽度为400个像素,高度等比例压缩 \' .Rotate = 1 \'顺时钟旋转90° End With End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") \' .Add("btn2","返回","button",PageURL) \'生成返回原来页面的按钮 End With e.WriteString(wb.Build) \'生成网页 MessageBox.Show(1) Else \'保存编辑结果 Dim dr As DataRow = DataTables("表B").AddNew dr("日期") = e.PostValues("日期") dr("编号1") = e.PostValues("编号1") dr("名称1") = e.PostValues("名称1") Dim max As Integer = DataTables("表B").Compute("max(序列)","") dr("序列")= max + 1 Dim lst As List(of String) = dr.Lines("图片") \'获取文件集合 Dim Int As Integer = lst.Count MessageBox.Show(int) For Each key As String In e.files.Keys MessageBox.Show(key) ‘这里没有提示出来 , 没有 找到 e.files.keys 这个集合 For Each fln As String In e.Files(key) Int = Int + 1 e.SaveFile(key,fln,"c:\\web\\mefiles\\" & dr("名称") & dr("_identify") & "_" & Int & ".jpg") \'保存接收到的文件 lst.Add( dr("名称") & dr("_identify") & "_" & Int & ".jpg") Next Next MessageBox.Show(lst.Count) dr.Lines("图片") = lst dr.Save() With wb.AddMsgPage("","msgpage","提交成功", "") .AddButton("btn1","返回列表","fp.htm") .AddButton("btn2","返回主菜单","login.htm") End With e.WriteString(wb.Build) \'生成网页 MessageBox.Show(2) End If 请教 不知道 为什么 没有 e.files.keys 的 值? 也没有在 c:\\web\\mefiles\\ 这个位置 有任何文件找到
[此贴子已经被作者于2021/7/2 16:50:16编辑过]
|
-- 作者:有点蓝 -- 发布时间:2021/7/2 16:57:00 -- 参考:http://www.foxtable.com/mobilehelp/topics/0106.htm,要改为使用ajax提交数据 |