I am trying to check if a file exists in a virtual directory. I tried File.Exists but it always returns false. I am trying to see if the file exists so I can turn a control on or off.
I am using IIS 6.0, VS 2008.
I have attached a sample of my code below.
is defined as a virtual directory in IIS as an application.
I tried it with "Read" and "Directory Browsing" turned on.
DocPath = "http://www.awebsite.com/billimages/<dir>/<YYYYMM>/filename.pdf"
If File.Exists(DocPath) Then
Me.GetFBPdf.commandname = docpath
Me.GetFBPDF.Text = "View the FB Docs"
Me.GetFBPDF.Visible = True
FBFile = True
Me.GetFBPDF.Visible = False
FBFile = False