for each formName in upload.objFile ''列出所有上传了的文件
set oFile=upload.objfile(formName)
types=lcase(mid(oFile.filename,InStrRev(oFile.filename, ".")+1)) '判断文件扩展名
if upfiletype<>empty then '数据库中允许上传的文件列表
uptype=split(upfiletype,"|")
for j=0 to ubound(uptype)
if lcase(types)=lcase(uptype(j)) then
erro=true
exit for
end if
next
if erro=false then WriteErrMsg("您所上传的文件其中有系统禁止使用的文件类型!")
end if
……
批量上传时,我一次传两个以上文件,只能限制第一个文件,第二个,第三个...限制功能无效!
比如,我限制只允许传jpg,上传的时候,我第一个选择是jpg格式,第二个是其它格式,如:asp,那么,就没有任何提示,jpg和asp格式的两个都上传了,但我如果第一个选择的是asp文件,第二个选择的是jpg文件,就会有提示"不允许使用asp格式",但运行结果是jpg也没有传上去?请问这代码我该怎么改啊?
上传的文件列表表单名称为:file1、file2、file*.....
if erro=false then WriteErrMsg("您所上传的文件其中有系统禁止使用的文件类型!")
=>
if erro=false then
WriteErrMsg("您所上传的文件其中有系统禁止使用的文件类型!")
response.end()
end if
你WriteErrMsg()函数内容是什么啊?
小米虫,我的WriteErrMsg函数中已经有response.end()了
sub WriteErrMsg(errmsg)
dim strErr
strErr=strErr & "<html><head><title>错误信息</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbcrlf
strErr=strErr & "<link href='http://topic.csdn.net/t/20061219/18/../css/user.css' rel='stylesheet' type='text/css'></head><body><br><br>" & vbcrlf
strErr=strErr & "<table cellspacing=""0"" cellpadding=""0"" width=""97%"" align=""center"" border=""0"" class=""a2"">" & vbcrlf
| 论坛热门帖子: | [lch203] 写得蛮好的linux学习笔记(10-21) [黑马制造] 学习java的30个目标(10-19) [笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19) [udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18) [沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18) |
| TAG标签: | 问题 在线 上传 文件 关于 strErr vbcrlf if width WriteErrMsg |
注册
个人空间
