上传文件格式过滤

'----------------------------上传文件过滤--------------------
 Dim MyArray ,up
 MyArray = Array("jpg","gif","doc","pdf","ppt","txt","xls","rar","swf","fla","zip","")

 up=1
 For I = Lbound(MyArray) to Ubound(MyArray)
  if trim(Lcase(right(objUpload.FileType(objUpload.FieldName(ii)),3)))=MyArray(I) then
   up=0
   exit for
  else
   up=1
  end if
 Next
 
 if up=1 then
 
 %>
 <script language="vbscript">
  msgbox "文件格式错误!",vbInformation,"消息"
  history.back(0)
 </script>

原文地址:https://www.cnblogs.com/winner/p/356029.html