麻烦大家给我看下这个检测本地文件是否存在的问题
global_doc_name=request("global_doc_name")
'这是服务器文件名
savepath="..\upload\"&global_doc_depnick&"\"&global_doc_name
'这是本地文件名
str_f="D:\"&global_doc_name
'映射下
str_e = Server.MapPath(savepath)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
if IsFileExist(str_f) then
response.write "<script>alert('文件存在!');</script>"
response.write "<script>"_
&" history.back(1);</script>"
response.end
fs.CopyFile str_f,str_e
set fs=nothing
else
response.write "<script>alert('文件不存在!');</script>"
response.write "<script>"_
&" history.back(1);</script>"
response.end
end if
Function IsFileExist(strFileName)
SET FSO=Server.CreateObject("Scripting.FileSystemObject")
IF(FSO.FileExists(strFileName))THEN
IsFileExist = True
ELSE
IsFileExist = False
END IF
SET FSO=NOTHING
End Function
但是好奇怪,本地的永远检测不出来,明明已经存在了,而且打印出来的本地的文件位置+名字也对,就是永远提示文件不存在