T
tanya.wang
I want to access files from a remote server so I mapped it in my
server under z:\ for \\myserver\web\mysite\images\
I added this UNC path to my IIS virtual directory and name it as
"upload"
but I still cannot use any FSO to read it. Here is my code:
<%
Dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
'Method one- NOT exist
if fs.FileExists("\\myserver\web\mysite\images\xxx.gif")=true then
response.write("File exists!")
else
response.write("File NOT exist!")
end if
'Method two - NOT exist as well
if fs.FileExists("Z:\xxx.gif")=true then
response.write("File exists!")
else
response.write("File NOT exist!")
end if
%>
But if i run this html on where my asp is located, it can read this
file -
<img src='../upload/xxx.gif' >
I tried to use server.MapPath("../upload/") but i got this result
D:\Web\sys\upload
While my asp file is located in D:\web\sys
the problem is that there's no physical drive under D:\
I really have no clue here.
All I want to do is to check if a file exists on \\myserver\web\mysite
\images\
If yes then I am going to delete it.. that's why I need to use FSO.
Anyone has ideas?
server under z:\ for \\myserver\web\mysite\images\
I added this UNC path to my IIS virtual directory and name it as
"upload"
but I still cannot use any FSO to read it. Here is my code:
<%
Dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
'Method one- NOT exist
if fs.FileExists("\\myserver\web\mysite\images\xxx.gif")=true then
response.write("File exists!")
else
response.write("File NOT exist!")
end if
'Method two - NOT exist as well
if fs.FileExists("Z:\xxx.gif")=true then
response.write("File exists!")
else
response.write("File NOT exist!")
end if
%>
But if i run this html on where my asp is located, it can read this
file -
<img src='../upload/xxx.gif' >
I tried to use server.MapPath("../upload/") but i got this result
D:\Web\sys\upload
While my asp file is located in D:\web\sys
the problem is that there's no physical drive under D:\
I really have no clue here.
All I want to do is to check if a file exists on \\myserver\web\mysite
\images\
If yes then I am going to delete it.. that's why I need to use FSO.
Anyone has ideas?