回 帖 发 新 帖 刷新版面

主题:罕见ASP错误

以下是一个过程的代码:
sub DelFiles(strUploadFiles)
if strUploadFiles="" then exit sub
if DelUpFiles="Yes" and ObjInstalled=True then
dim fso,arrUploadFiles,i
Set fso = CreateObject("Scripting.FileSystemObject")
if instr(strUploadFiles,"|")>1 then
arrUploadFiles=split(strUploadFiles,"|")
for i=0 to ubound(arrUploadFiles)
if fso.FileExists(server.MapPath("" & arrUploadfiles(i))) then
fso.DeleteFile(server.MapPath("" & arrUploadfiles(i)))
end if
next
else
if fso.FileExists(server.MapPath("" & strUploadfiles)) then
fso.DeleteFile(server.MapPath("" & strUploadfiles))
end if
end if
Set fso = nothing
end if
end sub
这是一个删除服务器上的文件的过程,但当我运行的时候却出现以下错误:
Server.MapPath() 错误 'ASP 0214 : 80004005' 
无效路径参数 
路径参数超过了最大允许长度。 

请大侠们指点。谢谢。有点急。

回复列表 (共2个回复)

沙发

显示一下路径看看呢?这种错误确实很少见,或者用trim函数去掉变量前后的空格呢。

Response.Write server.MapPath("" & arrUploadfiles(i))

板凳

我试了一下,还是显示这样的错误,我也在网上查了一下,也有人遇此错误,有的人说是没启用父路径,也有人说是IIS的设置上的错误,还有人说是保存路径的那个数据库字段没用UNICODE编码压缩,但是试了一下,都没用。

我来回复

您尚未登录,请登录后再回复。点此登录或注册