如何限制上傳檔案的副檔名
如何限制上傳檔案的副檔名如:
我只想上傳副檔名為EXE或RAR的檔案
這個代碼哪位帥哥有啊?
cType="rar,exe" '文件类型
Function getExt(name)
getExt = right(name, 3)
End Function
Function isf(fileName, fType)
ext = getExt(fileName)
isf = False
typeList = split(fType, ",")
For ii = LBound(typeList) To UBound(typeList)
If UCase(ext) = UCase(typeList(ii)) Then
isf = True
Exit For
End If
Next
End Function
If isf(fileName, cType) Then
上传
else
..........
仅供参考
[此贴子已经被作者于2007-7-20 19:04:33编辑过]