473,387 Members | 3,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

FileExists FSO

If I do the following :
------------------------------------
set fsd=Server.CreateObject("Scripting.FileSystemObjec t")
if fsd.fileexists("C:\inetpub\wwwroot\mysite\test.doc ") = true then
response.Write("EXISTS")
else
response.write "DOESNT EXIST"
end if
-------------------------------------
I get : "EXISTS"
-------------------------------------
However if I do this :
---------------------------------------
set fsd=Server.CreateObject("Scripting.FileSystemObjec t")
myfile = "C:\inetpub\wwwroot\mysite\test.doc"
if fsd.fileexists(myfile) = true then
response.Write("EXISTS")
else
response.write "DOESNT EXIST"
end if
---------------------------------
I get :"DOESNT EXIST"
---------------------------------
Can anyone help ?
This is driving me nuts.
Jul 19 '05 #1
3 2029
I failed to reproduce the issue.
have u tried with a different finename? path?
--
Roji. P. Thomas
SQL Server Programmer
"Poppy" <pa**********@NOSPAMthemedialounge.com> wrote in message
news:uf*************@TK2MSFTNGP11.phx.gbl...
If I do the following :
------------------------------------
set fsd=Server.CreateObject("Scripting.FileSystemObjec t")
if fsd.fileexists("C:\inetpub\wwwroot\mysite\test.doc ") = true then
response.Write("EXISTS")
else
response.write "DOESNT EXIST"
end if
-------------------------------------
I get : "EXISTS"
-------------------------------------
However if I do this :
---------------------------------------
set fsd=Server.CreateObject("Scripting.FileSystemObjec t")
myfile = "C:\inetpub\wwwroot\mysite\test.doc"
if fsd.fileexists(myfile) = true then
response.Write("EXISTS")
else
response.write "DOESNT EXIST"
end if
---------------------------------
I get :"DOESNT EXIST"
---------------------------------
Can anyone help ?
This is driving me nuts.

Jul 19 '05 #2
Poppy wrote on 02 mrt 2004 in microsoft.public.inetserver.asp.general:
set fsd=Server.CreateObject("Scripting.FileSystemObjec t")
if fsd.fileexists("C:\inetpub\wwwroot\mysite\test.doc ") = true then
response.Write("EXISTS")
else
response.write "DOESNT EXIST"
end if
-------------------------------------
I get : "EXISTS"
-------------------------------------
However if I do this :
---------------------------------------
set fsd=Server.CreateObject("Scripting.FileSystemObjec t")
myfile = "C:\inetpub\wwwroot\mysite\test.doc"
if fsd.fileexists(myfile) = true then
response.Write("EXISTS")
else
response.write "DOESNT EXIST"
end if
---------------------------------
I get :"DOESNT EXIST"


You must have made a mistake because my code hereunder works ok:

<%
set fsd=Server.CreateObject("Scripting.FileSystemObjec t")
if fsd.fileexists(server.mappath("test.asp")) then
response.Write "EXISTS"
else
response.write "DOESNT EXIST"
end if

set fsd=Server.CreateObject("Scripting.FileSystemObjec t")
myfile = server.mappath("test.asp")
if fsd.fileexists(myfile) then
response.Write "EXISTS"
else
response.write "DOESNT EXIST"
end if
%>

btw:

1
if x = true then
is the same as
if x then

2
response.Write("EXISTS")
is the same as
response.Write "EXISTS"

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3
I fixed it.

I just performed a reboot and everything was OK.

Thanks

"Roji. P. Thomas" <la********@nowhere.com> wrote in message
news:uW**************@TK2MSFTNGP09.phx.gbl...
I failed to reproduce the issue.
have u tried with a different finename? path?
--
Roji. P. Thomas
SQL Server Programmer
"Poppy" <pa**********@NOSPAMthemedialounge.com> wrote in message
news:uf*************@TK2MSFTNGP11.phx.gbl...
If I do the following :
------------------------------------
set fsd=Server.CreateObject("Scripting.FileSystemObjec t")
if fsd.fileexists("C:\inetpub\wwwroot\mysite\test.doc ") = true then
response.Write("EXISTS")
else
response.write "DOESNT EXIST"
end if
-------------------------------------
I get : "EXISTS"
-------------------------------------
However if I do this :
---------------------------------------
set fsd=Server.CreateObject("Scripting.FileSystemObjec t")
myfile = "C:\inetpub\wwwroot\mysite\test.doc"
if fsd.fileexists(myfile) = true then
response.Write("EXISTS")
else
response.write "DOESNT EXIST"
end if
---------------------------------
I get :"DOESNT EXIST"
---------------------------------
Can anyone help ?
This is driving me nuts.


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David P. Jessup | last post by:
I would like to know if I'm correct in the way I coded this: Function CheckFileExists(sFileName) If (fs.FileExists(sFileName)) Then CheckFileExists = True Else CheckFileExists = False End If...
1
by: Bob | last post by:
When a file is local to the ASP application, I can use the following code to test if the file exists: Dim strFileName, blnFileExists, objFSO strFileName = Server.MapPath( "\MyFiles\test.doc" )...
4
by: DMTman | last post by:
Who can help me to create a backup strategy that will copy the backend.mdb into separate folders representing either the time, or just folders that are sequentially numbered. I need this for...
4
by: MLH | last post by:
What utility was used in Access 2.0 to check for the existence of a file on disk?
8
by: worldbadger | last post by:
Hello there, I have a subform that has anywhere from 20-500 ID numbers (unique) listed on it. Each ID is going to be linked to a picture. First off I set up a check for existance of the file;...
4
by: Christian Blackburn | last post by:
Hi Gang, I am unable to get either system.io.fileexists() = true or Dir() <> "" to work in my ASP.net/VS 2003 web project. Can someone tell me or point me to some instructions on how to enable...
1
by: bay_dar | last post by:
It seems there has got to be a better way to work with log files where I want to keep 8 days of logs. For instance if I wanted to keep 80 days, this would be a horrible approach. How can I make...
17
by: Lazareth | last post by:
Hi I have a program that sends an email to selected recipients. I have two forms. One that creates and send the email and another that is used to select recipients and other information. ...
1
by: emilyragsdale | last post by:
I'm doing research for my employer, and I'm looking for a library for ASP.net that allows you to post an Excel spreadsheet online and have clients enter their data, saving and storing the data on our...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.