473,473 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

FSO FileExists Method

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
End Function

If CheckFileExists(Whichfolder & flindex & ".tif") Then
'java code to display the tif inline with the browser
else
'code stating there is no file to display
End if

I just want to make sure that (Whichfolder & flindex & ".tif") which is an
actual file path is what is being passed to the Function CheckFileExists as
sFileName

Thanks from this ASP Newbie
Jul 19 '05 #1
4 6223
Hi David,

That should work, although you don't really have to encapsulate it in a
function like that. You can just do:
If fs.FileExists("C:\Path\file.xt") Then
'''code
Else
'''code
End If

Ray at work

"David P. Jessup" <davidATimntDASHtechDOTcom> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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
End Function

If CheckFileExists(Whichfolder & flindex & ".tif") Then
'java code to display the tif inline with the browser
else
'code stating there is no file to display
End if

I just want to make sure that (Whichfolder & flindex & ".tif") which is an
actual file path is what is being passed to the Function CheckFileExists as sFileName

Thanks from this ASP Newbie

Jul 19 '05 #2
You could always check with some basic debugging:
Function CheckFileExists(sFileName)
response.write "Filename is " & sFileName
...

I just want to make sure that (Whichfolder & flindex & ".tif") which is an
actual file path is what is being passed to the Function CheckFileExists as sFileName

Jul 19 '05 #3
Thanks Ray

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi David,

That should work, although you don't really have to encapsulate it in a
function like that. You can just do:
If fs.FileExists("C:\Path\file.xt") Then
'''code
Else
'''code
End If

Ray at work

"David P. Jessup" <davidATimntDASHtechDOTcom> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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
End Function

If CheckFileExists(Whichfolder & flindex & ".tif") Then
'java code to display the tif inline with the browser
else
'code stating there is no file to display
End if

I just want to make sure that (Whichfolder & flindex & ".tif") which is an actual file path is what is being passed to the Function CheckFileExists

as
sFileName

Thanks from this ASP Newbie


Jul 19 '05 #4
Heh,
Thanks Aaron, you proved why I use the sig: Thanks from this ASP NEWBIE =)

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
You could always check with some basic debugging:
Function CheckFileExists(sFileName)
response.write "Filename is " & sFileName
...

I just want to make sure that (Whichfolder & flindex & ".tif") which is an actual file path is what is being passed to the Function CheckFileExists

as
sFileName


Jul 19 '05 #5

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

Similar topics

3
by: Poppy | last post by:
If I do the following : ------------------------------------ set fsd=Server.CreateObject("Scripting.FileSystemObject") if fsd.fileexists("C:\inetpub\wwwroot\mysite\test.doc") = true then...
11
by: Dave Rahardja | last post by:
OK, so I've gotten into a philosophical disagreement with my colleague at work. He is a proponent of the Template Method pattern, i.e.: class foo { public: void bar() { do_bar(); } protected:...
5
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
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: daniel.w.gelder | last post by:
I wrote a template class that takes a function prototype and lets you store and call a C-level function, like this: inline string SampleFunction(int, bool) {..} functor<string (int, bool)>...
7
by: greenflame | last post by:
I am trying to make a matrix object. I have given it some properites. I am trying to add a method. When I call the method by Test.showDims(...) I want to only enter one input, that is the method by...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.