<INPUT id="File_1" type="file" name="File_1" runat="server">
Dim abc As String = File_1.PostedFile.FileName
Dim FPath1 As String = Server.MapPath("abc/" & abc) '保存路径和文件名
Dim Ftype1() As String = Split(FPath1, ".") '判断文件类型
If Len(Path.GetFileName(File_1.PostedFile.FileName)) <= 0 Then
ErrorList.Text = "请选择证书图片!"
p1.Visible = True
ElseIf LCase(Path.GetExtension(File_1.PostedFile.FileName)) <> ".jpg" And LCase(Path.GetExtension(File_1.PostedFile.FileName)) <> ".gif" Then
ErrorList.Text = "请上传JPG、GIF文件!"
p1.Visible = True
ElseIf File_1.PostedFile.ContentLength > 1048576 Then
ErrorList.Text = "上传的文件不能超过1M"
p1.Visible = True
Else
File_1.PostedFile.SaveAs(FPath1)
End IF