I am not an ASP programmer, I'm a network administrator. I'm trying to help our ASP programmer who has become stumped by this problem. If I get a workable answer today (we are under a deadline) I will at least double the point value.
We have the following code which is looking for the existence of a specific image file, then building it into an "IMG SRC" string. If the file doesn't exist I want it to instead use a default image file.
In the first line, if PropertyPictFilePath is set to a local path i.e. "c:\somepathname\" it works. If it is set to "\\thiswebserver\somepathn
ame\" If it is set as shown below, it doesn't find anything, so all images are shown as the default, even when the image exists.
I think the problem has to do with permissions... the pictures are not located on the webserver but on another server. This is a very large folder of pictures and we don't have enough disk space available on the real web server to hold it. Instead, they are served via a website that is getting content from a network share.
Both servers are members of the same domain but NOT domain controllers.
The actual question: How do I enable the webserver's asp code to access the folder on the network unc path?
The code snippet is supposed to check the existence of the file at \\servername\somepathname\
gif and if it exists, build a path for inclusion in the resulting http of http://someurl.com/picture01.gif
. If it doesn't exist the path will be built as http://someurl.com/DefaultPicture.gif
". someurl.com is the url of a website whose content is coming from \\servername\somepathname.
As I said if the propertypictfilepath is on the local machine either by "c:\..." or by a unc, it works fine but doesn't work when the unc is a different machine.
Alternatively, can you provide a code sample that transparently fetches the file from the webserver, and if it detects a 404 error would substitute the default image.
Here's the existing code:
Private Const PropertyPictFilePath = "\\servername\somepathname
Private Const PropertyPictHttpPath = "http://someurl.com/
Private Const PropertyDefaultImage = "DefaultPicture.gif"
Set fso = CreateObject("Scripting.Fi
if (not fso.FileExists(PropertyPic
tFilePath & PropertyPhoto))then
PropertyPhoto = PropertyDefaultImage
Set fso = Nothing
GetPropertyPic = PropertyPictHttpPath & PropertyPhoto