Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Checking for File Existinance


Message #1 by "Kenneth Perel" <Excite@i...> on Wed, 17 Oct 2001 22:58:10
Hi Kenneth,

If it is for an Intranet, you may want to look into the "File System 
Object" This object can be scripted from VB-script and JavaScript / 
JScript. You may need to change some security settings, like allowing 
Active X controls.

Here is an example:
http://support.microsoft.com/support/kb/articles/Q229/6/93.ASP

The FSO also has a method called FileExists, which you can use to check 
for the file.

Check out the docs for scripting and the FSO at:
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?
contentid=28001169
or do a search for "File System Object".


Hope this helps,

Imar



> I have an intranet site that opens pdf files.  A javascript functions 
> creates the filename depending upon user entered criteria.  My problem 
is 
> I do not yet have a complete set of pdf files for each possible 
filename.  
> I have been trying to use the file.exist () function with no success.  
Can 
> some one please help me with the following question:
> 
> Is there a way to check is a file exists before I try to open the 
file.  I 
> am using the window.open () command to open the PDF file.  Can I create 
a 
> boolean express such as 
> 
> if file exists window.open ().
> 
> Any help would be appreciated.  
> 
> Thank you,
> 
> kenneth Perel

  Return to Index