Image not displaying

G

Guest

Hi,

I have an image which resides on a different server...on data server. I am
developing on Development server. When I use the image URLin my ASP.Net web
page as xxx.xxx.x.xx\\SHARE\GRAPHICS\image.jpg , that image shows up in the
development server but when I use my local machine for vewing that image , it
doesnt show up...Why is that?
 
K

Kevin Spencer

Because a URL is not UNC. You need to either create a virtual directory
that points to that location, or us File IO to get the image.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
G

Guest

Hi Kevin,

How to go create a virtual directory which points to the location of the
image and how to create a file IO to get that image? It might be a very basic
question, but I would be glad if you could help.

Thanks
 
K

Kevin Spencer

Hi pmud,

Well, you want to do one OR the other, NOT both. The first option would be
done through Internet Information Services Admin. It might be best to ask a
network administrator to do that for you. A virtual directory is simply a
web directory that points to a real directory somewhere, not necessarily in
the web server's folders.

The second option is fairly self-explanatory. You use System.IO classes to
open the file, and write it to the Response.OutputStream. Your app will have
to have permission to open the file.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
G

Guest

Hi Kevin,

In IIS I browsed to Default Websites , then in my website folder called APP,
I right clicked & created a new Virtual Directory which points to
C:/Inetpub/wwwroot/APP . Inside APP i created an image folder which contains
the image. But when i see it from my local machine, with the URL for the site
as :
http//xxx.xx.x.x/APP/Default.aspx , i still cant see the image, or when I
use the name of the Virual directory in the path, as
http//xxx.xx.x.x/VirtualDir/APP/Default.aspx , i still cant see the image
displayed.

Did I do it the right way? If yes, then why is it not displaying?
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top