以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]手机上传接受图片问题。 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=136775) |
-- 作者:wangyi5056 -- 发布时间:2019/6/21 11:24:00 -- [求助]手机上传接受图片问题。 老师:这段代码手机端数据填入后台接受很好,但是照片在前台上传时只能一张或多张,不能一张一张的传很不方便,所以,我又看到第二个例子代码,这个例子上传功能,挺好但是在只存到了指定目录,没有在数据表中显示也不方便。我的问题是怎样把第二个例子功能融入到第一个例子里面,实现数据、照片上传,后台可以接收到数据和照片的数据,方便管理。 一、Dim wb As New weui 二、Select Case e.Path
Case "upload.htm" |
-- 作者:有点甜 -- 发布时间:2019/6/21 11:41:00 -- Case "receive.htm"
|
-- 作者:wangyi5056 -- 发布时间:2019/6/21 15:04:00 -- 老师,代码融合完了如下,但是最后有一个新问题,请帮忙!我在代码中加了多行输入也就是“情况说明”,但是在后台接收不到数据,怎么办?别的接收都没有问题了。谢谢! Select Case e.Path Case "addnew.htm" Dim wb As New weui wb.AddForm("","form1","receive.htm") With wb.AddInputGroup("form1","ipg1","文件上传") .AddInput("姓名","姓名","Text").Placeholder = "选填" \'前一个"姓名"是ID,后一个"姓名"是标题 .AddInput("电话","电话","number").Placeholder = "必填" .AddSelect("类别","类别","环境|食品|其他") .AddInput("位置","位置","Text").Placeholder = "必填" With .AddUploader("up1","照片",True) .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 End With With wb.AddInputGroup("form1","ipg2","情况说明") .AddTextArea("bz",3).Placeholder = "请输入100字以内的备注" End With End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "button").Attribute= "" \'调用js函数上传 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) \'生成网页 Case "receive.htm" Dim nms() As String = {"姓名","电话","类别","位置","情况说明"} Dim dr As DataRow = DataTables("表A").AddNew() 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, ProjectPath & "Attachments\\" & fln) Next dr.Lines("照片") = e.Files(key) End If Next \'保存并生成增加成功提示页面 dr.save() e.WriteString("OK") End Select |
-- 作者:有点甜 -- 发布时间:2019/6/21 15:32:00 -- 改成
With wb.AddInputGroup("form1","ipg2","情况说明")
.AddTextArea("情况说明",3).Placeholder = "请输入100字以内的备注"
End With
|