No Images from VPN

D

David C

I have an ASP.Net 2.0 page that displays images in a DataList from a virtual
directory on a different server in the domain. All works fine at a regular
workstation, but when I log in via our VPN the images do not show, only a
red X shows where the image should be. Any ideas why this happens and where
I need to look to get them to display?

Below is how I am populating the DataList.

Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

If Not Page.IsPostBack Then

Dim strpath As String = "/MyWeb/Photos/DAUCHY, JOE/RO25369"

Dim dirInfo As New DirectoryInfo(Server.MapPath(strpath))


PhotoList.DataSource = dirInfo.GetFiles("*.jpg")

PhotoList.DataBind()

End If

End Sub

David
 
G

Guest

are you accessing images via https? obviously it's not able to find the url
for image. can u right-click on broken image and look at the url?
 
D

David C

No, we are accessing images directly from server url, e.g.
\\server\share\somefile.jpg

David
 
S

Samuel R. Neff

Try using a fully-qualified server name..

\\server.yourcompany.com\share\somfile.jpg

Or better yet put the images on the web server and reference them
through http.

HTH,

Sam

------------------------------------------------------------
We're hiring! B-Line Medical is seeking .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
 
H

Hans Kesting

No, we are accessing images directly from server url, e.g.
\\server\share\somefile.jpg

David

You *hope* to reference those images by that path. But Server.MapPath returns
an absolute path like "C:\whatever\MyWeb\Photos\DAUCHY, JOE\RO25369\".
This will work fine on the system where the image is, but not if you are
accessing
it from some other computer (whether VPN or not).
Look at the html source in the browser and try to locate the image. What
is the
URL that you find there?
You will have to translate the image path back to some path that is accessible
via IIS.

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top