set upload=new upload_5xSoft
set file=upload.file("file1")
formPath=session("picpath")
if file.filesize>100 then
fileExt=lcase(right(file.filename,3))
if fileExt<>"jpg" and fileExt<>"gif" and fileExt<>"bmp"then
Response.Write"对不起,只能上传 jpg,gif和bmp图像!"
end if
end if
取它的最后三位,也就是扩展名,看是不是jpg gif bmp?
js判断是不够的,服务段还要再判断
<input type="file" id="testfile" onpropertychange="vbscript:hzm=right(testfile.value,3):if hzm<>'jpg' or hzm<>'gif' or hzm<>'bmp' then msgbox('不准上传') end if">