以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  图片上传问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=175564)

--  作者:yifan3429
--  发布时间:2022/3/9 23:55:00
--  图片上传问题
.AddSelect("学历","学历","大专|本科|硕士|博士")
.AddUploader("up1","
图片",True) \'True表示允许上传多个文件
上面的代码方案可以保存图片

换成下面的代码方案就不能保存了

With wb.AddInputGroup("form1","ipg35","图片上传")
        With .AddUploader("up1","图片",True) \'True表示允许上传多个文件
            .AllowDelete = True \'允许删除
            .Incremental = True \'允许 重复选择文件或连续拍照
            .ScaleWidth = 400 \'自动压缩图片宽度为400个像素,高度等比例压缩
        End With
    End With

文件保存代码

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, "e:\\web\\uploadfiles\\" & fln)
Next
dr.Lines("图片") = e.Files(key)
End If
Next


找不出问题,请教老师



--  作者:yifan3429
--  发布时间:2022/3/10 9:03:00
--  
 老师在吗
--  作者:有点蓝
--  发布时间:2022/3/10 9:33:00
--  
参考:http://www.foxtable.com/mobilehelp/topics/0106.htm
--  作者:yifan3429
--  发布时间:2022/3/14 22:34:00
--  
 Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI \'定义一个基于weui框架的网页生成器
 Select Case e.Path
    Case "upload.html"
                wb.AddForm("","form1","receive.html")
        With wb.AddInputGroup("form1","ipg1","文件上传")
            With .AddUploader("up128","照片",True)
                .AllowDelete = True \'允许删除
                .Incremental = True \'允许重复选择文件或连续拍照
            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.html"
        For Each key As String In e.Files.Keys
            For Each fln As String In e.Files(key)
                e.SaveFile(key,fln,"e:\\web\\uploadfiles\\" & fln) \'保存接收到的文件
            Next
        Next
        e.WriteString("OK")
End Select

抄的帮助代码 无改变


 js也是加载好的,点击确定就是没有反应

图片点击可在新窗口打开查看此主题相关图片如下:企业微信截图_20220314223208.png
图片点击可在新窗口打开查看


以下内容是专门发给有点蓝浏览

[此贴子已经被作者于2022/3/14 22:35:02编辑过]

--  作者:有点蓝
--  发布时间:2022/3/14 23:30:00
--  
httprequest事件完整代码发上来
--  作者:yifan3429
--  发布时间:2022/3/14 23:47:00
--  
  Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI \'定义一个基于weui框架的网页生成器
 Select Case e.Path
    Case "upload.html"
                wb.AddForm("","form1","receive.html")
        With wb.AddInputGroup("form1","ipg1","文件上传")
            With .AddUploader("up128","照片",True)
                .AllowDelete = True \'允许删除
                .Incremental = True \'允许重复选择文件或连续拍照
            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.html"
        For Each key As String In e.Files.Keys
            For Each fln As String In e.Files(key)
                e.SaveFile(key,fln,"e:\\web\\uploadfiles\\" & fln) \'保存接收到的文件
            Next
        Next
        e.WriteString("OK")
End Select

这就是完整代码呀
一个"upload.html"选择     一个  "receive.html"接收
js原文

function submitWithProgress(){ var result = submitAjaxForm(\'form1\',\'afterSubmit\',true,\'tst1\'); } function afterSubmit(result){ hide("tst1"); if (result==\'OK\') { show("tst2"); location="upload.htm"; } else{ show("tst3",2000); } }
参考帮助
http://www.foxtable.com/mobilehelp/topics/0139.htm

还需要其他的代码配合吗
[此贴子已经被作者于2022/3/14 23:48:59编辑过]

--  作者:有点蓝
--  发布时间:2022/3/15 8:23:00
--  
上面是内部函数的代码,我要看httprequest事件代码
--  作者:yifan3429
--  发布时间:2022/3/15 10:25:00
--  
Dim drx As DataRow = DataTables("内部函数表").SQLFind("网页=\'" & e.Path & "\'")
If drx IsNot Nothing Then
    Functions.Execute(drx("函数名称"),e)
End If


--  作者:有点蓝
--  发布时间:2022/3/15 10:31:00
--  
请上传实例说明
--  作者:yifan3429
--  发布时间:2022/3/15 12:49:00
--  
 老师您好
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:手机多图上传.rar


请指教
[此贴子已经被作者于2022/3/15 12:53:36编辑过]