files exists or not - says that it doesn't exist 
Author Message
 files exists or not - says that it doesn't exist

You ASP code is checking for the file on the server.  I assume by "local workstation" you mean the
one running the browser client.   You can't sniff for client side files from server side code...

--
Michael Harris
MVP Scripting

Hello,

Help would be muchly appreciated. Thanks in advance.

I am trying to test for the existence of a file on the local workstation
using VBScript on an asp page.  Below is the code that I am trying to make
functional.

Even though the file "C:\TEMP\npcknet.dll" exists, the message that it
"doesn't exist." is still displayed.  What am I missing.


<%
Dim fso, msg, file_name
 file_name="C:\TEMP\npcknet.dll"
 Set fso = CreateObject("Scripting.FileSystemObject")
  If (fso.FileExists(file_name)) Then
      msg = file_name & " exists."
  Else
    msg = file_name & " doesn't exist."
  End If

response.write (msg)
%>

Dave Stephens



Mon, 18 Nov 2002 03:00:00 GMT  
 files exists or not - says that it doesn't exist
Hello,

Help would be muchly appreciated. Thanks in advance.

I am trying to test for the existence of a file on the local workstation
using VBScript on an asp page.  Below is the code that I am trying to make
functional.

Even though the file "C:\TEMP\npcknet.dll" exists, the message that it
"doesn't exist." is still displayed.  What am I missing.


<%
Dim fso, msg, file_name
 file_name="C:\TEMP\npcknet.dll"
 Set fso = CreateObject("Scripting.FileSystemObject")
  If (fso.FileExists(file_name)) Then
      msg = file_name & " exists."
  Else
    msg = file_name & " doesn't exist."
  End If

response.write (msg)
%>

Dave Stephens



Mon, 18 Nov 2002 03:00:00 GMT  
 files exists or not - says that it doesn't exist

Quote:
> You ASP code is checking for the file on the server.  I assume by "local

workstation" you mean the
Quote:
> one running the browser client.   You can't sniff for client side files

from server side code...

Is there any way to get a security message to pop-up to let users know a
script is going to see if a file exists on their local machine, and to get
permission to do so?  An app I am trying to make needs a script to detect
the location of the user's cd-rom drive.  It will only run if IE is set to
low security.
  -dave



Fri, 22 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. asyncread doesn't tell if file doesn't exists

2. fRefreshLinks Doesn't work if path doesn't exist

3. File existing or not existing?

4. If a file doesn't exist?

5. Doesen't doesn't exist

6. When an Object doesn't exist ?

7. RegRead throws an exception when the variable doesn't exist

8. RegRead:. Key doesn't exist

9. type database doesn't exist?

10. Display message if database to import to doesn't exist

11. RefreshLink when .MDB doesn't exist

12. If directory doesn't exist, then create

 

 
Powered by phpBB® Forum Software