1、uc浏览器测试正常;
2、微信浏览器等一些常用浏览器不正常,需要变通,处理,比较麻烦,如
Select Case e.Path
Case "test.htm", ""
Dim wb As New weui
wb.AddForm("","form1","123.htm?test=123abc") '指定接收表单数据的的页面为handle.htm
With wb.AddInputGroup("form1","ipg1","客户资料")
.AddInput("姓名","姓名","text").value = "舒淇"
.AddInput("地点","地点","text").Value = "蒙古草原"
.AddInput("日期","日期","date").value = #10/12/2012#
With .AddUploader("up1","",True)
.AllowDelete = True '允许删除
.Incremental = False '允许重复选择文件或连续拍照
'.AllowAdd = True '关闭文件上传功能
.AddImage("./images/001.jpg")
.AddImage("./images/002.jpg")
.AddImage("./images/003.jpg")
End With
End With
Dim str = ""
str &= " var glr=document.getElementById('up1_gallery');"
str &= " var idx=(glr.index)?glr.index:0;"
str &= " var ary =glr.attributes['data-images'].value.split('|');"
str &= " alert(ary[idx]);"
str &= " document.getElementById('ifile').src=\""downpic.htm?key=\"" +ary[idx];"
str = str.replace("'", "\""")
wb.AppendHTML("<script>up1_gallery.children[1].children[0].children[0].style.display='none';up1_gallery.children[1].innerHTML+=""<i class='weui_icon_download' ></i>""</script>")
wb.InsertHTML("<iframe id='ifile' style='display:none'></iframe>")
e.WriteString(wb.Build)
Case "downpic.htm"
try
Dim fs As System.IO.FileStream = Nothing
fs = System.IO.File.Open("c:\web\" & e.Values("key"), System.IO.FileMode.Open)
Dim btFile As Byte() = New Byte(fs.Length - 1) {}
fs.Read(btFile, 0, Convert.ToInt32(fs.Length))
fs.Close()
e.Response.Headers("Content-Disposition") = "attachment;filename=" & FileSys.GetName(e.Values("key"))
'输出文件格式
e.Response.ContentType = "application/octet-stream"
Dim output = e.response.OutputStream
output.Write(btFile,0,btFile.Length)
output.Close()
catch ex As exception
'msgbox(ex.message)
End try
End Select
3、因为foxtable的uploader控件,显示的不是img元素,而是一个背景图片而已,所以无法直接另存图片的。
建议你换成比如这个 http://www.foxtable.com/mobilehelp/scr/0079.htm
或者,别的第三方picture插件,如 http://www.jq22.com/search?seo=%E5%9B%BE%E7%89%87%E4%B8%8A%E4%BC%A0
[此贴子已经被作者于2019/3/18 16:31:30编辑过]