Subscribe Bookmark RSS Feed

File Exists () - can this work with HTML path?

djhanson

Community Trekker

Joined:

Jun 23, 2011

Are there any tricks to get File Exists() to work with an internal html path (internal meaning a network drive represented as an html path and not UNC path)?

So far I cannot get it to recognize a file path that exists using the html path representation like below.  Are there any tricks to make this work or some other file check related command perhaps?  DJ

file exists("p:\\mypath\test.jsl"); //UNC path works (can find the JSL that exists)

file exists("html://mycompanyserver.com/mypath/test.jsl"); //HTML path does not work (cannot find the JSL that exists)

3 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

you can get the results you need by using a Load Text File function and if it can not load it, the result will be a missing value.

DoesItExist = Try(Load Text File(("html://mycompanyserver.com/mypath/test.jsl"));

If(char(DoesItExist) == ".", ....................);

Jim
msharp

Super User

Joined:

Jul 28, 2015

Another option is to map the network drive to Z: (or whatever).  The caution here is that different individuals in your company may have their network drives mapped differently (or not at all).  If you have a good IT department they should have already standardized this and it shouldn't be an issue.  Regardless, if this is for scripts you are only running on your computer there shouldn't be an issue.

10589_pastedImage_0.png

txnelson

Super User

Joined:

Jun 22, 2012

An additional word of caution on using a Mapped Network drive, the file that you are testing for are on a web server.  They may not be on a server that supports MS Windows Mapping access.  At my company, Linux is used for the web servers, without any Samba(Windows file services emulator) installed.  So the method I previously specified is what I had to use.

Jim