Hi, Martha
Remember that ASP Pages run with the IUSR_LocalMachine user by default.
Probably, that user doesn't have read access to the file indicated
("d:\Inetpub\wwwroot\matlsmain\getcruisin\matlsmain\webreports\mach.snp"),
and you get the "doesn't exist" message.
Check the read access for this user.
Pedro Luna
[EMAIL PROTECTED]
----- Original Message -----
From: "Martha Graves" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 10, 2001 2:12 PM
Subject: FileExists Method
I am trying to use MapPath and FileExists to test whether or not a file
exists
before attempting to display the report. The idea being that if the file
isn't
there, I can redirect to an text file with an error message. I am doing
some
tests on a file that I know exists on the server, but the FileExists code
that I
have keeps returning False. I am hoping someone can look at the code and
see
where I am going astray. Here is the code:
<%
FileName = Server.MapPath("getcruisin/matlsmain/webreports/mach.snp")
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists(FileName) = true then
Response.Write("<br>File " & FileName & " exists.")
else
Response.Write("<br>File " & FileName & " does not exist.")
end If
set fs=nothing
%>
And the result says:
File d:\Inetpub\wwwroot\matlsmain\getcruisin\matlsmain\webreports\mach.snp
does
not exist.
Any help would be appreciated.
Thanks, Martha
^^^^^^^^^^^^^^^^^^^ http://asp-lists.com/ ^^^^^^^^^^^^^^^^^^
Get Your ASP On The Fast Track!
Join the growing number of Application Service Provider pros
using the ASP-Lists to maximize their company's potential.
_____________ The Manufacturing Industry ASP Discussion List
_____________
To Join: mailto:[EMAIL PROTECTED]
To Remove: mailto:[EMAIL PROTECTED]
Archives: http://www.asp-lists.com/industrial/manufacturing/archives/
^^^^^^^^^^^^^^^^^^^ http://asp-lists.com/ ^^^^^^^^^^^^^^^^^^
Get Your ASP On The Fast Track!
Join the growing number of Application Service Provider pros
using the ASP-Lists to maximize their company's potential.
_____________ The Manufacturing Industry ASP Discussion List _____________
To Join: mailto:[EMAIL PROTECTED]
To Remove: mailto:[EMAIL PROTECTED]
Archives: http://www.asp-lists.com/industrial/manufacturing/archives/