2

I am having some issue to load some images stocked in a server in my network.

From Windows Explorer, the path is something like this :

 \\192.168.84.52\Distri\Affiche\10038P.jpg

I tried something like this :

<img src= "\\192.168.84.52\Distri\Affiche\10038P.jpg" alt="logo" />
<img src= "file://///192.168.84.52/Distri/Affiche/10038P.jpg" alt="logo" />

But it did not work. Another issue is that when someone try to see the url of the image, I would like it to not show the path 192.168.84.52 . Is it possible to use an aspx page and pass the image name so that it will load the image ?

For exemple something like this

 image.aspx/10038P.jpg

Well yeah it is not really a parameter,

Exia0890
  • 441
  • 6
  • 21
  • This `\\192.168.84.52\Distri\Affiche\10038P.jpg` is probably not going to work the way you might think. Is this an Intranet site? – David Tansey Aug 14 '13 at 03:32
  • No, it is a public site, the `192.168.84.52` is the ip (in intern) of the server where the images are saved. – Exia0890 Aug 14 '13 at 03:35
  • I have the same issue. But, the one I am having is an `intranet` site. Do you have any idea about how to make it work? – Vikram Jun 17 '14 at 20:57

1 Answers1

4

I think that your best (and simplest) approach might to be to map a virtual directory using the UNC-type paths you have shown. Then you can address the files in your html in a more 'normal' way (effectively hiding the UNC server name as you've requested).

You could, for instance, map UNC \\192.168.84.52\Distri\Affiche\ to virtual folder images and then reference the image file names from folder images in your html.

The following doc describes setting up virtual folders, please note the special instructions for UNC mappings.

http://msdn.microsoft.com/en-us/library/bb763173(v=vs.100).aspx

David Tansey
  • 5,813
  • 4
  • 35
  • 51
  • Thanks for your answer, Your solution seems to do exactly what I need. But right now I am working in local so can't really test. But I found another solution that works as well [here](http://stackoverflow.com/questions/7970755/accessing-image-from-other-server) . – Exia0890 Aug 14 '13 at 04:47
  • @DavidTansey, Thanks a lot for the solution!!! I was having another issue. I was trying to read images from some particular folder located at "C:\FolderName" on each of the environments (Dev, QA, Prod etc.). The folder (on each environment) was later shared and made accessible using UNG path. When I was running locally, it was running fine. The issue that was happening was I was not able to view the images when running website through IIS of each environment. I referred your solution and now it is running fine! Thanks again!!! – Vikram Jun 17 '14 at 21:46