Dim fl As String = "d:\web\" & e.path
If filesys.FileExists(fl)
Dim idx As Integer = fl.LastIndexOf(".")
Dim ext As String = fl.SubString(idx)
Select Case ext
Case ".jpg",".gif",".png",".bmp",".wmf",".js",".css" ,".html",".htm",".zip",".rar"
e.WriteFile(fl)
Return '这里必须返回
End Select
End If
Select Case e.Path
Case "addnew.htm",""
Dim wb As New WeUI
If e.PostValues.Count = 0 Then
wb.AddForm("","form1","receive.htm")
With wb.AddInputGroup("form1","ipg1","举报内容")
With .AddUploader("up1","照片1",False)
.AllowDelete = True
.Incremental = True '允许重复选择文件或连续拍照
.ScaleWidth = 800 '自动压缩图片宽度为400个像素,高度等比例压缩
End With
With .AddUploader("up2","照片2",False)
.AllowDelete = True
.Incremental = True '允许重复选择文件或连续拍照
.ScaleWidth = 800 '自动压缩图片宽度为400个像素,高度等比例压缩
End With
With .AddUploader("up3","照片3",False)
.AllowDelete = True
.Incremental = True '允许重复选择文件或连续拍照
.ScaleWidth = 800 '自动压缩图片宽度为400个像素,高度等比例压缩
End With
With .AddUploader("up4","照片4",False)
.AllowDelete = True
.Incremental = True '允许重复选择文件或连续拍照
.ScaleWidth = 800 '自动压缩图片宽度为400个像素,高度等比例压缩
End With
With .AddUploader("up5","照片5",False)
.AllowDelete = True
.Incremental = True '允许重复选择文件或连续拍照
.ScaleWidth = 800 '自动压缩图片宽度为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.AppendHTML("<script src='./lib/ajaxform.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页
End If
Case "receive.htm"
Dim wb As New WeUI
'保存图片
'msgbox(e.Files.Keys.count)
'For Each key As String In e.Files.Keys
'For Each fln As String In e.Files(key)
'' e.SaveFile(key,fln,"d:\web\uploadfiles\" & fln)
'Dim lst As List(of String) = dr.Lines("照片1") '获取文件集合
'lst.Add(fln) '给集合增加一个文件
'dr.Lines("照片1") = lst '将新的集合赋值给文件列
'
'
'Next
'
'
'
'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
End If
If key = "up2" Then
For Each fln As String In e.Files(key)
e.SaveFile(key, fln, ProjectPath & "Attachments\" & fln)
Next
End If
If key = "up3" Then
For Each fln As String In e.Files(key)
e.SaveFile(key, fln, ProjectPath & "Attachments\" & fln)
Next
End If
If key = "up4" Then
For Each fln As String In e.Files(key)
e.SaveFile(key, fln, ProjectPath & "Attachments\" & fln)
Next
End If
If key = "up5" Then
For Each fln As String In e.Files(key)
e.SaveFile(key, fln, ProjectPath & "Attachments\" & fln)
Next
End If
Next
e.WriteString("OK")
End Select