smithmrk
asked on
ASP.net - IIS Virtual Directory
Hello Experts!
I have a Virtual Directory setup in my IIS under my Web Site that points to another server that has my images. I can not seem to figure out how to get my Web Site to see this Virtual Directory to pull the images.
Please see attached Screen Shots.
ImageFile = Server.MapPath("~/PayeeVal idation_Im ages")
Thanks,
Mark
ErrorMessage.jpg
IIS-Setup.jpg
I have a Virtual Directory setup in my IIS under my Web Site that points to another server that has my images. I can not seem to figure out how to get my Web Site to see this Virtual Directory to pull the images.
Please see attached Screen Shots.
ImageFile = Server.MapPath("~/PayeeVal
Thanks,
Mark
ErrorMessage.jpg
IIS-Setup.jpg
It might be a permissions issue. Are you using anonymous access or windows authentication? Does the application pool user (the identity running the app pool) have permissions for the share?
ASKER
No permission issues...It can't see the file?
This is what I'm doing to see if it can see the file:
If File.Exists(Server.MapPath ("~/PayeeV alidation_ Images/" & ImageFileName.Trim)) = True Then
lbl_Client.Text = "YES"
Else
lbl_Client.Text = "NO"
End If
It keeps coming up as NO...however this works:
for ImageURL...but I need to OPEN the Image First:
DocumentImage.ImageUrl = System.Configuration.Confi gurationMa nager.AppS ettings("P ayeeValida tion_Image Path") & "/" & ImageFileName.Trim
This is what I'm doing to see if it can see the file:
If File.Exists(Server.MapPath
lbl_Client.Text = "YES"
Else
lbl_Client.Text = "NO"
End If
It keeps coming up as NO...however this works:
for ImageURL...but I need to OPEN the Image First:
DocumentImage.ImageUrl = System.Configuration.Confi
ASKER
OK, so here is an example...it is telling me NO the file does not exists, but the image displays on the screen for the ImageURL.
NO - \\10.1.115.27\D$\PayeeVali dation_Ima ges\200013 5_1F.png
I need to open the image file first before I display it on the screen to get the Image Height and Width.
Mark
NO - \\10.1.115.27\D$\PayeeVali
I need to open the image file first before I display it on the screen to get the Image Height and Width.
Mark
and if you try to open \\10.1.115.27\D$\PayeeVali dation_Ima ges\200013 5_1F.png in explorer from the server the file opens?
What's the System.Configuration.Confi gurationMa nager.AppS ettings("P ayeeValida tion_Image Path") value?
What's the System.Configuration.Confi
ASKER
Yes, I can open those files from my Mapped Drive L:\PayeeValidation_Images
The AppSetting is just the name of the folder = "PayeeValidation_Images".. .that's all.
In case the folder name should ever change I could just change it in the WebConfig.
Mark
The AppSetting is just the name of the folder = "PayeeValidation_Images"..
In case the folder name should ever change I could just change it in the WebConfig.
Mark
Try putting another entry for the physical path . . . use your L: instead of the mapped path.
The mapped drive may be accessing a share or something rather then the hidden (D$) drive.
The mapped drive may be accessing a share or something rather then the hidden (D$) drive.
ASKER
OK, maybe I have something setup wrong in the IIS?
I have a mapped drive L:\ that I can see the images from.
I also have it setup in IIS as \\10.1.115.27\D$\PayeeVali dation_Ima ges...beca use it would not let me select the L:\ Mapped Drive from IIS.
I logged in and can see the images from IIS when I click on the Virtual Directory and when I use the command I showed you above I can display the Image using the URL however I need to be able to Open the Image so I can get the Height and Width, this is where I can not figure out why it can even see the images?
I just tried this and now I'm getting Logon Failure BUT it still displays my image?
Dim DirInfo As New DirectoryInfo(Server.MapPa th("~/Paye eValidatio n_Images/" ))
Dim DirFiles As FileInfo() = DirInfo.GetFiles()
Mark
I have a mapped drive L:\ that I can see the images from.
I also have it setup in IIS as \\10.1.115.27\D$\PayeeVali
I logged in and can see the images from IIS when I click on the Virtual Directory and when I use the command I showed you above I can display the Image using the URL however I need to be able to Open the Image so I can get the Height and Width, this is where I can not figure out why it can even see the images?
I just tried this and now I'm getting Logon Failure BUT it still displays my image?
Dim DirInfo As New DirectoryInfo(Server.MapPa
Dim DirFiles As FileInfo() = DirInfo.GetFiles()
Mark
ASKER
I found this...
Which seems to work when adding that line to my Web.Config File:
http://www.codingdefined.com/2014/08/using-unc-path-for-storing-and.html
Mark
Which seems to work when adding that line to my Web.Config File:
http://www.codingdefined.com/2014/08/using-unc-path-for-storing-and.html
Mark
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help!
Mark
Mark