For Each File in Upload.Files FileExt=Lcase(replace(File.ext,".","")) "服务器端判断文件类型,动网论坛的判断方式 If CheckFileExt(FileExt)=false then Response.write "文件格式不正确,或不能为空 [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
else File.SaveAs articlepath & "/" & NewName & File.ext Response.Write "New name: " & File.FileName & "<BR>" End If
Next
%> <% "服务器端判断文件类型,动网论坛的判断方式 Private Function CheckFileExt(FileExt)
If FileExt="" or IsEmpty(FileExt) Then CheckFileExt=false Exit Function End If If Lcase(FileExt)="asp" or Lcase(FileExt)="asa" or Lcase(FileExt)="aspx" then CheckFileExt=false Exit Function End If If Lcase(FileExt)="gif" or Lcase(FileExt)="jpg" or Lcase(FileExt)="png" or Lcase(FileExt)="swf" or Lcase(FileExt)="bmp" then CheckFileExt=true Exit Function Else CheckFileExt=false End If End Function %>