Microsoft VBScript 运行时错误 '800a0005'无效的过程调用或参数: 'Instr'

从后台上传软件时出现这个报警,麻烦帮忙解决一下!报警内容:Microsoft VBScript 运行时错误 '800a0005' 无效的过程调用或参数: 'Instr' /upload.asp, line 656代码:if Instr(intTemp,strItem,"filename=""")<>0 thenif not objForm.Exists(strInam&"_From") then strFileItem=strFileItem&strSplit&strInam if binItem.Size<>0 then intTemp=intTemp+13 strFtyp=Mid(strItem,Instr(intTemp,strItem,"Content-Type: ")+14) strTemp=Mid(strItem,intTemp,Instr(intTemp,strItem,"""")-intTemp) intTemp=InstrRev(strTemp,"/") strFnam=Mid(strTemp,intTemp+1) objForm.Add strInam&"_Type",strFtyp objForm.Add strInam&"_Name",strFnam objForm.Add strInam&"_Path",Left(strTemp,intTemp) objForm.Add strInam&"_Size",lngFsiz if Instr(intTemp,strTemp,".")<>0 then //这里是656行 strFext=Mid(strTemp,InstrRev(strTemp,".")+1) else strFext="" end if

问题补充:

这个解决了:把 if Instr(intTemp,strTemp,".")<>0 then 改成 if Instr(intTemp,strTemp)<>0 then就可以了,只是现在只能传jpg不能传rar,代码如下:uploadtype="jpg/rar/swf/"size=Uprequest.Form("file_size")showsize=size & " Byte" if size>1024 then size=(size/1024) showsize=size & " KB" end if if size>1024 then size=(size/1024) showsize=formatnumber(size,2) & " MB" end if response.write "<script language=""javascript"">parent.form1.size.value='"&showsize&"';" response.write "</script>" response.write "<div style=""padding-top:5px;padding-bottom:5px;""> <font color=red>文件上传成功</font> [<a href='javascript:history.go(-1)'>重新上传</a>]</div>" end if

提问者:

 

 

 

 

最佳答案

 

if Instr(intTemp,strItem,"filename=""")<>0 then这句中间的最后两个引号去掉,看看InStr 函数的用法返回某字符串在另一字符串中第一次出现的位置。InStr([start, ]string1, string2[, compare])参数start可选项。数值表达式,用于设置每次搜索的开始位置。如果省略,将从第一个字符的位置开始搜索。如果 start 包含 Null,则会出现错误。如果已指定 compare,则必须要有 start 参数。string1必选项。接受搜索的字符串表达式。string2必选项。要搜索的字符串表达式。compare可选项。指示在计算子字符串时使用的比较类型的数值。有关数值,请参阅“设置”部分。如果省略,将执行二进制比较。设置compare 参数可以有以下值:常数 值 描述 vbBinaryCompare 0 执行二进制比较。 vbTextCompare 1 执行文本比较。

 

 

这个应该是你上传的文件包含路径的问题!

 

你没有说清楚后面的错误代码,你试下在IE(如果你是IE7及以上版本)的选项里面

安全里面的自定义级别,里面有一个包含上传文件 路径,这个是禁用的,你启用就好了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值