Foxtable(狐表)用户栏目专家坐堂 → [分享]ios11.3以上无法上传提交图文的问题解决方案


  共有3793人关注过本帖树形打印复制链接

主题:[分享]ios11.3以上无法上传提交图文的问题解决方案

帅哥哟,离线,有人找我吗?
浙江仔
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
[分享]ios11.3以上无法上传提交图文的问题解决方案  发帖心情 Post By:2018/7/18 15:24:00 [只看该作者]

ios11.3以上不能使用ajax提交图文的formdata问题困扰了我好久,但是针对网页开发没有什么基础,比较习惯狐表的前端

所以想办法使用微信上传图片的方法,获取图片的素材id,然后服务端下载素材保存到指定地方。

显示的时候,关闭uploader的上传功能

虽然交互上有点区别,但是还是能用的,有需要的可以看看



主页面代码:

Http_File_Do_DTL_wx

 

Dim e As RequestEventArgs = Args(0)

Dim openid As String

Dim entid As String

Dim workitemid As String

Dim Dtlid As String

Dim ss As String

Dim wb As New WeUI

Dim xdr As DataRow

Dim entname As String

Dim sdate As String=format(Date.Today,"yyyyMMdd")

Dim fxlx As String ="完成|未完成"

Dim gov As String

If e.host=Vars("V_host") Then

    gov="gov"

End If

 

If  e.GetValues.ContainsKey("gov") Then

    gov=e.GetValues("gov")

End If

 

If  e.GetValues.ContainsKey("itemid") Then

    workitemid=e.GetValues("itemid")

End If

 

If  e.GetValues.ContainsKey("fileid") Then

    ss =e.GetValues("fileid")

End If

 

If  e.GetValues.ContainsKey("delwid") Then  '删除操作

    Dim r1 As DataRow=DataTables("C_PYH_WORK_Process").SQLFind(" dtl_id='" & e.GetValues("delwid") & "' ")

    If r1 IsNot Nothing

        r1("IS_ACTIVE")="0"

        r1("UPDATE_TIME")=now.Tostring.replace("-","").replace(" ","").replace(":","")

        r1.save()

        workitemid=r1("WORK_id")

    End If

   

    '删除成功提示

    With wb.AddMsgPage("","msgpage","删除成功", "认真 仔细 务实!") '生成成功提示页

        With wb.AddButtonGroup("","btg1",False)  '垂直排列

            .Add("btn1","返回","","/entFilesInfo.htm?fileid=" & workitemid )

            .Add("btn3", "撤销删除","", "/Filedodtl.htm?recwid=" &  e.GetValues("delwid") ).Kind = 1

        End With

       

    End With

    e.WriteString(wb.Build)

    Return ""

   

End If

 

If  e.GetValues.ContainsKey("recwid") Then '恢复删除

   

    Dim r1 As DataRow=DataTables("C_PYH_WORK_Process").SQLFind(" dtl_id='" & e.GetValues("recwid") & "' ")

    If r1 IsNot Nothing

        r1("IS_ACTIVE")="1"

        r1.save()

        workitemid=r1("WORK_id")

    End If

   

    '删除成功提示

    With wb.AddMsgPage("","msgpage","撤销删除成功", "认真 仔细 务实!") '生成成功提示页

        .AddButton("btn1","返回","/entFilesInfo.htm?fileid=" & workitemid)

    End With

    e.WriteString(wb.Build)

    Return ""

   

End If

 


Dim fh As String="False"

Dim fdd As DataRow

Dim fdp As DataRow

If gov="gov" Then

    If e.Cookies.ContainsKey("openid") Then '从cookie中获取微信用户id

        ' Openid = e.Cookies("openid")

        Openid = Functions.Execute("CheckOpenid",e.Cookies("openid"))

    End If

   

Else

    If e.Cookies.ContainsKey("pxopenid") Then '从cookie中获取微信用户id

        Openid = e.Cookies("pxopenid")

    End If

   

    Dim fdx As DataRow= DataTables("S_PYH_WCHACT_INFO").SQLFind("WCHAT_ID= '" & Openid & "' and IS_ACTIVE='1' ")

    If fdx IsNot Nothing Then

        entid = fdx("enterprise_id")

        Dim xd As DataRow=DataTables("C_EI_ENTERPRISEINFO").SQLFind("enterprise_id='"& entid &"' and is_active='1' ")

        If xd IsNot Nothing Then

            entname=xd("enterprise_name")

        End If

    Else

        With wb.AddMsgPage("","msgpage","缺少必要信息,无法访问", "认真 仔细 务实!") '生成成功提示页

            .icon = "Warn" '改变图标

            .AddButton("btn1","返回","/entFilesInfo.htm?fileid=" & SS )

        End With

        e.WriteString(wb.Build)

        Return ""

    End If

   

End If

 

If e.PostValues.Count = 0  Then  ' 评估页面首次打开

    wb.AddPageTitle("","ph1","落实反馈记录")

    wb.AppendHTML("<script src='https://res.wx.qq.com/open/js/jweixin-1.2.0.js'></script>",True) '引入JS-SDK库

    wb.AppendHTML("<script src='./lib/ajaxform_wxfk.js'></script>") '引入脚本文件

   

    wb.AppendHTML("<link rel='stylesheet' href='weui/weui.me.css'>")

    '在页面注入权限验证配置

    Dim st As New Date(1970,1,1,8,0,0)

    Dim appid As String = Vars("VCorpID_mp")  'CorpID

    Dim timestamp As Integer = CInt((Date.Now - st).TotalSeconds()) '时间戳

    Dim noncestr As String = Rand.NextString(16) '随机字符

    Dim url As String  = e.Request.URL.ToString   '当前页面地址

    'Dim r As Row=Tables("表B").AddNew()

    'r("第一列")=url

    Dim signature As String = Functions.Execute("GetJsSignature_mp", noncestr, timestamp, url) '生成权限验证签名

    Dim cfg As String = "wx.config({appId:'{0}',timestamp:{1},nonceStr:'{2}',signature:'{3}',jsApiList:['checkJsApi','chooseImage','previewImage','uploadImage','downloadImage','getNetworkType','openLocation','getLocation','scanQRCode']});"

    wb.AppendHTML("<script>" & CExp(cfg,appid,timestamp,noncestr,signature) & "</script>",True)

    '开始正常生成网页内容

   

   

    wb.AddToast("","tst1", "正在上传",1)

    wb.AddToast("","tst2", "反馈成功",0)

    wb.AddToast("","tst3", "反馈失败",0).Icon= "warn"

    wb.AddTopTips("","toptip1","请选择完成状态,输入情况描述!")

    wb.AddForm("","form1","wxUpload.htm")

   

   

    With wb.AddDialog("","dlg1", "反馈成功","") '增加订单失败提示框

        ' .AddButton("btnOK","确定","/entFilesInfo.htm?fileid=" + ss  )

        If gov="gov" Then

            .AddButton("btnOK","确定","/Filedodtl.htm?itemid=" + workitemid )

        Else

            .AddButton("btnOK","确定","/entPIindex.htm")

        End If

       

    End With

    With wb.AddDialog("","dlg3", "错误","") '增加订单失败提示框

        .AddButton("btnOK","确定")

    End With

   

    With wb.AddInputGroup("form1","post","")

        .AddHiddenValue("post",Functions.Execute("POSTEncrypt"))

    End With

   

    If workitemid >""  Then      '校验是否历史记录,若是历史记录

        xdr = DataTables("C_PYH_WORK_Process").SQLFind("dtl_id=  '" & workitemid & "' and is_active='1' ")

        With wb.AddInputGroup("form1","ipg1","报送单位:" + xdr("enterprise_name"))

            .AddHiddenValue("work_id",ss)

            .AddHiddenValue("workitemid",workitemid )

            .AddHiddenValue("serverid","")

            With .AddUploader("up1","照片资料",True) 'True表示允许上传多个文件

                .AllowAdd = False

                Dim sdr As  DataRow = DataTables("C_PYH_WORK_Proc_FILES").SQLFind("process_id = '" & xdr("dtl_id")  & "' and IS_ACTIVE ='1' ")

                If sdr IsNot Nothing Then

                    For Each dr As DataRow In DataTables("C_PYH_WORK_Proc_FILES").SQLSelect("process_id = '" & xdr("dtl_id")  & "' and is_active='1' ")

                        If dr("FILES_SAVENAME_S") <>"" Then

                            .AddImage(  dr("FILES_SAVENAME_S"),  dr("FILES_SAVENAME"))

                        Else

                            .AddImage(  dr("FILES_SAVENAME") )

                        End If

                    Next

                End If

            End With

           

            ' Dim fjlx As String =fxlx.replace(xdr("WORK_STATUS"),"["& xdr("WORK_STATUS") & "]")

           

        End With

        wb.InsertHTML("","<div id='divlist'>")

        wb.InsertHTML("","</div>") '占位的DIV标签的结束标签

        wb.InsertHTML("","<div id='divlist2'>")

        wb.InsertHTML("","</div>") '占位的DIV标签的结束标签

        With wb.AddButtonGroup("form1","btup",False)

            .Add("chooseimage", "选择图片", "button").Kind = 1

            '.Add("previewimage", "上传图片", "button").Kind = 1

        End With

       

       

        With wb.AddInputGroup("form1","ipg2","情况描述(上报时间:" + xdr("publish_date") +")")

            If xdr("WORK_STATUS")="完成" Then

                .AddSelect("WORK_STATUS","完成状态","[完成]|未完成" )

            Else

                .AddSelect("WORK_STATUS","完成状态","完成|[未完成]" )

            End If

            Dim pname As String=Functions.Execute("getPNameByOpenid",xdr("creator"))

            If pname>"" Then

                .AddInput("xm","上报人","text").value=pname

            End If

            .AddTextArea("WORK_CONTENT").Value = xdr("WORK_CONTENT")

        End With

       

       

        With wb.AddButtonGroup("form1","btg1",False)


                .Add("btn1", "更新上报", "button").Attribute= "" '调用js函数上传

                If xdr("creator")=openid Then

                    .Add("btn2","删除","","/Filedodtl.htm?delwid=" & workitemid ).Kind = 2

                End If

           

            .Add("btn3","返回").Attribute = ""

        End With

       

    Else  '空白记录显示

        With wb.AddInputGroup("form1","ipg1","")

            With .AddUploader("up1","照片资料",True) 'True表示允许上传多个文件

                .AllowAdd = False

            End With

        End With

        wb.InsertHTML("","<div id='divlist'>")

        wb.InsertHTML("","</div>") '占位的DIV标签的结束标签

        wb.InsertHTML("","<div id='divlist2'>")

        wb.InsertHTML("","</div>") '占位的DIV标签的结束标签

        With wb.AddButtonGroup("form1","btup",False)

            .Add("chooseimage", "选择图片", "button").Kind = 1

            '.Add("previewimage", "上传图片", "button").Kind = 1

        End With

       

        With wb.AddInputGroup("form1","ipg2","情况描述")

            .AddSelect("WORK_STATUS","完成状态","|"+ fxlx)

            .AddHiddenValue("work_xx","kong")

            .AddHiddenValue("work_id",ss)

            .AddHiddenValue("workitemid",workitemid )

            .AddHiddenValue("serverid","")

 

            .AddTextArea("WORK_CONTENT").Placeholder = "请输入200字以内的进展情况描述,可简短描述"

        End With


    End If

   

End if

 

e.WriteString(wb.Build)


页面js代码:


wx.ready(function () {


   // 5.1 拍照、本地选图

  var images = {

    localId: [],

    serverId: []

  };


  document.getElementById('chooseimage').onclick = function () {

    wx.chooseImage({

//count: 2, // 默认9

        success: function (res) {

        images.localId = res.localIds;

        //alert('已选择 ' + res.localIds.length + ' 张图片');

var i = 0, length = images.localId.length;

    images.serverId = [];

    function upload() {

      wx.uploadImage({

        localId: images.localId[i],

        success: function (res) {

          i++;

          //alert('已上传:' + i + '/' + length);

          images.serverId.push(res.serverId);

          if (i < length) {

            upload();

          }

document.getElementById("serverid").value = res.serverId + "</p>" + document.getElementById("serverid").value;

        },

        fail: function (res) {

          alert(JSON.stringify(res));

        }

      });

    }

    upload();

document.getElementById("divlist").innerHTML ='已选择 ' + res.localIds.length + ' 张图片';

      }

    });

  };

});

wx.error(function (res) {

    //alert(res.errMsg);

});


function submitForm(){

var v0 = document.getElementById("work_id").value;

var v4 = document.getElementById("workitemid").value;

var v1 = document.getElementById("work_content").value;

var v2 = document.getElementById("work_status").value;

var v3 = document.getElementById("serverid").value;

if (v3){

}

else

{

if(v4){

}

else{

alert("请先选择图片再上传!");

return;

}


}


if (v1 && v2 ){

show("tst1");

var result = sendAjaxText(v0+"|"+v4+"|"+v1+"|"+v2+"|"+v3,"wxUpload.htm","afterSubmit",true);

 }

else

{

show("toptip1",2000);

}

}



function afterSubmit(result){

    hide("tst1");

    if (result=='OK') {

showDialog('dlg1','上报成功','你的反馈已接收,请在上报记录查看上报情况!')

    }

    else{

showDialog('dlg3','错误',result)

    }

}



ajax字符串接收网页:


Http_File_Upload_wx (wxUpload.htm

 

Dim e As RequestEventArgs = Args(0)

Dim str As String = e.PlainText

Dim wb As new WeUI

Dim openid As String

Dim entid As String

Dim entname As String

Dim sdate As String=format(Date.Today,"yyyyMMdd")

If e.Cookies.ContainsKey("pxopenid") Then '从cookie中获取微信用户id

    Openid = e.Cookies("pxopenid")

End If

 

Dim fdx As DataRow= DataTables("S_PYH_WCHACT_INFO").SQLFind("WCHAT_ID= '" & Openid & "' and IS_ACTIVE='1' ")

If fdx IsNot Nothing Then

    entid = fdx("enterprise_id")

    Dim xd As DataRow=DataTables("C_EI_ENTERPRISEINFO").SQLFind("enterprise_id='"& entid &"' and is_active='1' ")

    If xd IsNot Nothing Then

        entname=xd("enterprise_name")

    End If

Else

    With wb.AddMsgPage("","msgpage","缺少必要信息,无法访问", "认真 仔细 务实!") '生成成功提示页

        .icon = "Warn" '改变图标

        .AddButton("btn1","返回","/entPIindex.htm")

    End With

    e.WriteString(wb.Build)

    Return ""

End If

 

 

Dim ss As String

Dim workitemid As String

Dim content As String

Dim status As String

Dim mediaids As String

Dim Values() As String

Values = str.split("|")

If values.length=5 Then

    ss=Values(0)

    workitemid =Values(1)

    content=Values(2)

    status=Values(3)

    mediaids=Values(4)

End If


 

Dim dr As DataRow

 

If workitemid >"" Then  '判断是否已有记录

    dr = DataTables("C_PYH_WORK_Process").SQLFind("dtl_id=  '" & workitemid & "' and is_active='1' ")

Else '否则新增记录

   

    Dim mdr As DataRow =DataTables("C_PYH_WORK_Process").SQLFind("WORK_id ='"& ss &"' and IS_ACTIVE='1' and WORK_STATUS ='"& status &"'  And  dept_id='"& entid &"' ")

    If mdr IsNot Nothing Then

        dr = mdr

        workitemid=mdr("dtl_id")

    Else

        dr=DataTables("C_PYH_WORK_Process").SQLAddNew()

        workitemid =Guid.NewGuid().ToString().replace("-","")

        dr("work_id")=ss

        dr("CREATE_TIME")=now.Tostring.replace("-","").replace(" ","").replace(":","")

        dr("dtl_id")=workitemid

        dr("IS_ACTIVE")="1"

        dr("publish_date")=sdate

        If openid>"" Then

            dr("creator")=openid

            dr("dept_id")=entid

            dr("enterprise_name")=entname

        Else

            dr("creator")="test"

            dr("dept_id")="2DB0F74160C94EBD8CD7BB3F186ED4D1"

        End If

    End If

End If

 

dr("WORK_STATUS")=status

dr("WORK_CONTENT")=content

 

'保存并生成增加成功提示页面

 

dr("UPDATE_TIME")=now.Tostring.replace("-","").replace(" ","").replace(":","")

dr.save()

 

 

 

Dim Pics() As String=mediaids.replace("</p>","|").split("|")

For i As Integer =0 To pics.length-1

    If pics(i)>"" Then

        Dim s As String=Functions.Execute("Http_WX_Pic_save",pics(i),"process")

        Dim dr2 As DataRow = DataTables("C_PYH_WORK_Proc_FILES").SQLAddNew()

        If s <>"失败" And s<> "" Then

            Dim s0 As String= s  & ".jpg"  '保存的文件名

            Dim s1 As String= s & "-s.jpg"   '保存的文件名

            dr2("FILES_SAVENAME") = s0

            dr2("FILES_SAVENAME_S") = s1

        Else

            Functions.Execute("ErrLogText",pics(i) + "素材获取失败!")

        End If

       

        dr2("FILES_NAME") = pics(i)

        dr2("file_id")=Guid.NewGuid().ToString().replace("-","")

        dr2("process_id")=workitemid

        dr2("CREATE_TIME")=now.Tostring.replace("-","").replace(" ","").replace(":","")

        dr2("UPDATE_TIME")=now.Tostring.replace("-","").replace(" ","").replace(":","")

        dr2("IS_ACTIVE")="1"

        If openid>"" Then

            dr2("creator")=openid

        Else

            dr2("creator")="test"

        End If

        dr2.save()

    End If

Next


e.WriteString("OK")





微信上传素材下载:

Http_WX_Pic_save

 

Dim mediaID As String=args(0)

Dim ps As String =args(1)   'process

 

Dim y As String =Date.Today.year.Tostring

Dim m As String=Date.Today.Month.Tostring

Dim s As String=Guid.NewGuid().ToString().replace("-","")

 

Dim s0 As String= s  & ".jpg"  '保存的文件名

Dim s1 As String= s & "-s.jpg"   '保存的文件名

Dim fl As String = ProjectPath & "web\upload\" & ps & "\" & y & "\" & m & "\"

Dim sucess As Boolean = True '用于标记是否下载成功

Dim url As String = "https://api.weixin.qq.com/cgi-bin/media/get?access_token={0}&media_id={1}"

url = CExp(url, Functions.Execute("GetAccessToken"), mediaID)


Dim hc As New HttpClient(url)

try

    If hc.GetFile(fl & s0) Then

        If hc.ResponseContentType.StartsWith("text/plain") Then

            Dim jo As JObject = JObject.Parse(Filesys.ReadAllText(fl))

            Functions.Execute("ErrLogText","素材下载失败1:" + jo.ToString)

            FileSys.DeleteFile(fl) '删除文件

            sucess = False

        End If

    Else

        sucess = False

    End If

   

Catch ex As Exception

    Vars("gettoken") =True

    Functions.Execute("ErrLogText","素材下载失败2:" + ex.Message )

    url = CExp(url, Functions.Execute("GetAccessToken"), mediaID)

    Dim hc2 As New HttpClient(url)

    hc2.GetFile(fl & s0)

   

End Try

 

If sucess  Then

    Dim img As image = getImage(fl & s0)

    Dim bmp As bitmap = new bitmap(img , 50, 50)

    bmp.save(fl & s1)

    Functions.Execute("txtProgress","临时素材下载成功!")

    Return "./upload/" & ps & "/" & y & "/" & m & "/" & s

Else

   

    Return "失败"

End If




此主题相关图片如下:qq截图20180718143352.png
按此在新窗口浏览图片



此主题相关图片如下:微信图片_20180718152116.jpg
按此在新窗口浏览图片



 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/7/18 16:24:00 [只看该作者]

你可以修改weui.me.js的previewFile3函数,把得到的值赋值给一个自己的input文本框(type='hidden'),提交表单后在后台读取文本框的值(base64格式字符串),转换成图片即可,这个方法更简单方便。


 回到顶部
帅哥哟,离线,有人找我吗?
浙江仔
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2018/7/19 10:28:00 [只看该作者]

我加了一个
document.getElementById("picstr").value = base64Data+ "||" + document.getElementById("picstr").value;
但是多张图片,picstr这个值会被替换掉,只保留一个图片值

 回到顶部
帅哥哟,离线,有人找我吗?
浙江仔
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2018/7/19 10:35:00 [只看该作者]

应该在哪里修改,甜版指导一下

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/7/19 11:19:00 [只看该作者]

你 picstr 设置成hidden了没有?普通的文本框,有字符长度的限制的。

 

http://www.foxtable.com/mobilehelp/scr/0127.htm

 

http://www.foxtable.com/mobilehelp/scr/0028.htm

 


 回到顶部
帅哥哟,离线,有人找我吗?
浙江仔
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2018/7/19 11:38:00 [只看该作者]

页面设置应该没有问题
    wb.InsertHTML("form1","<input name='图片' id='picstr' type='hidden' ><br/>")
但是多张图片获取不全
获取的图片码只有一个

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20180719113419.png
图片点击可在新窗口打开查看

加入的代码这样对么?

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20180719113503.png
图片点击可在新窗口打开查看



 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/7/19 12:41:00 [只看该作者]

最开始文本框是没有值的,可能就是undefind,你没有给其赋值?

 

wb.InsertHTML("form1","<input name='图片' id='picstr' type='hidden' value='123'><br/>")


 回到顶部
帅哥哟,离线,有人找我吗?
浙江仔
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2018/7/19 14:13:00 [只看该作者]

1、主要是多个图片只能获取一个图片base64Data,不知道怎么改weui.me.js的previewFile3

2、还有这个previewFile3的base64Data是压缩过的图片还是原始图片?
 
3、或者把图文数据转为json,使用sendAjaxJSON的话,怎么把图文转成json?
[此贴子已经被作者于2018/7/19 14:27:59编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/7/19 15:22:00 [只看该作者]

我测试没问题。

 

1、

 

Select Case e.Path
    Case "test.htm", ""
        Dim wb As New weui
        wb.AddForm("","form1","receive.htm")
        With wb.AddInputGroup("form1","ipg1","文件上传")
            With .AddUploader("up128","照片",True)
                .AllowDelete = True '允许删除
                .Incremental = True '允许重复选择文件或连续拍照
                .ScaleWidth = 400 '自动压缩图片宽度为400个像素,高度等比例压缩
            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.InsertHTML("form1","<input name='picstr' value='' id='picstr' type='hidden' ><br/>")
        wb.AppendHTML("<script src='./lib/ajaxform.js'></script>") '引入脚本文件
        e.WriteString(wb.Build) '生成网页
    Case "receive.htm"
        msgbox(e.values("picstr").split("@").length-1)
        e.WriteString("OK")
End Select

 

2、

 

var pics = document.getElementById("picstr")
if(pics != null) {
pics.value = pics.value + "@" + base64Data
}


 回到顶部
帅哥哟,离线,有人找我吗?
浙江仔
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2018/7/19 15:58:00 [只看该作者]

谢谢,是ok了,人眼目测没有找到

谢谢


 回到顶部
总数 11 1 2 下一页