麻烦大家给我看下这个检测本地文件是否存在的问题

emerald83822 2007-03-28 03:26:31
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
但是好奇怪,本地的永远检测不出来,明明已经存在了,而且打印出来的本地的文件位置+名字也对,就是永远提示文件不存在
...全文
133 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
emerald83822 2007-03-28
  • 打赏
  • 举报
回复
把那个参数改成服务器的,倒可以检出服务器的,奇怪的很
孟子E章 2007-03-28
  • 打赏
  • 举报
回复
映射的?权限问题

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧