Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1730
  • Last Modified:

How to display image that has UNC path!

Hi, I am trying to display image where its src parameter is UNC path like the following:
<img id="imgViewer" src="\\user-89dc945c9a\3\Download.gif" border="0" alt="Download.gif" >

But the image does not appear.

if src parameter does not accept UNC path what is the alternative to make this image appear?
Please help.
0
Abdu_Allah
Asked:
Abdu_Allah
  • 3
  • 2
  • 2
  • +1
2 Solutions
 
b0lsc0ttCommented:
Abdu_Allah,

You could map the drive on that computer so that it is assigned a drive letter.  Use that path instead of the UNC path.  The tag will support that.  One very big disadvantage of that method is any computer accessing the page would have to have the drive mapped to the same letter.

b0lsc0tt
0
 
b0lsc0ttCommented:
I think you would be better off using a relative reference and keeping the image with the page.  For example you could store the image in the same directory as the page and just use...

<img id="imgViewer" src="Download.gif" border="0" alt="Download.gif" >

If you had a lot of images you could store it and the others in an images subfolder and use...

<img id="imgViewer" src="images\Download.gif" border="0" alt="Download.gif" >

0
 
Abdu_AllahAuthor Commented:
No way I must use UNC path, I cannot place the images in a local drive.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
nltechCommented:
try:

file:///server/share/path/file.ext
0
 
nltechCommented:
if that don't work, try this:
<img src="file://\\server\share\filename.gif" />    (worked in ie)
or
<img src="file:///\\server\share\filename.gif" />   (worked in ie, ff, and dw)
0
 
Abdu_AllahAuthor Commented:
>  (worked in ie) (worked in ie, ff, and dw)

This method works just if you open the webpage from inside firewall, but it fails if you open it from outside firewall.
0
 
Havin_itCommented:
I think, if you want things to be available to clients outside your Firewall (I assume you mean the entire Internet?), you ought to think about using a HTTP server.  That would have the advantage of unifying the path syntax required for your links.

If the server machine is running Windows 2000/XP Pro/2003 you already have the IIS server available.  Alternatively the Apache server ( http://httpd.apache.org ) is free and available for almost every platform imaginable.  If you'd like any advice on this, feel free to ask.
0
 
Abdu_AllahAuthor Commented:
Havin_it  please read my question again and try to understand it.
0
 
Havin_itCommented:
Okay, I must be misunderstanding something.  I saw you said it must be a UNC path, but then you mentioned people "outside the firewall" being able to see it too - can you explain more about what you mean when you say this?  I took it to mean outside your local network (i.e. from the Internet) but perhaps you meant something else.  Making UNC paths available to machines across the Internet would be possible, but a colossal security risk.  That's why I though using a HTTP server might suit you better.

Anyway, sorry if I misinterpreted this.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now