Dim e As RequestEventArgs = args(0)
If e.PostValues.Count = 0 Then
wb.AddForm("","form1","upload.htm")
With wb.AddInputGroup("form1","ipg1","上传产品图片")
'前一个"姓名"是ID,后一个"姓名"是标题
.AddInput("药材类目","药材类目","text")
With .AddUploader("up1","照片",False) 'True表示允许上传多个文件
.Incremental = True
.ScaleWidth = 400
End With
End With
With wb.AddPageFooter("","pf1","为了减少数据量,图片按类目上传,后面上传的图片将覆盖之前的!")
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "submit")
End With
If e.PostValues("药材类目")="" Then
wb.InsertHTML("药材类目必须输入!")
End If
e.WriteString(wb.Build)
Else
For Each key As String In e.Files.Keys
If key = "up1" Then
For Each fln As String In e.Files(key)
''MessageBox.show(fln)
e.SaveFile(key, fln, ProjectPath & "web\images\" & e.PostValues("药材类目") & ".jpg")
Next
End If
Next
'保存并生成增加成功提示页面
With wb.AddMsgPage("","msgpage","增加成功", e.PostValues("药材类目") & "的图片已提交到服务器!") '生成成功提示页
.AddButton("btn1","继续增加","upload.htm")
End With
e.WriteString(wb.Build)
End If
帮助里那个用js的有点不人性化 如果没有盯着手机看不知道结果