Click to See Complete Forum and Search --> : file path problem


SigmaX
08-05-2004, 10:48 AM
Hi,
How come this is not working? if I paste this address
(FilePath = "\\cbsapp014\qara_docs$\1.pdf") in either Windows Explorer or
a browser on my pc, It works and I see the pdf document. But my VBScript code
keeps saying file does not exist. Here's a piece of code


==============================================
FilePath = "\\cbsapp014\qara_docs$\1.pdf"

if FSO.FileExists(Filepath) Then
'open file

Else
'say file doesn't exist (I alwasy get this)
==============================================

I desperately need an answer. Here's some info about the server.

the .asp file including the code is in the webserver's root directory
which is (d:\notes\data\domino\html\). The server is IIS. However, the .pdf file is being accessed through a webshare with path (\\cbsapp014\qara_docs$\1.pdf)but the actual physical path is (d:\quara_docs\1.pdf).

I want to access it through the webshare (gives me permission control) but I keep getting file doesnt exist when I view the .asp page (works fine from windows explorer or IE.
What's wrong with the code above?

Greatly appreciate any help,

russell
08-06-2004, 03:08 AM
The asp scripting engine doesn't know about the share (myPath$). Use the UNC path:


FilePath = Server.Mappath("\\cbsapp014\qara_docs\1.pdf")

if FSO.FileExists(Filepath) Then
'open file


be sure the account that IIS is running under has permissions to the shared directory. Also, obviously, the share may be differnet than the actual path. For example, the share above might really be:
\\cbsapp014\someDirectory\anotherDir\yetAnotherDir\qara_docs\.

Make sure you know the full UNC.