简体   繁体   中英

Load image from an UNC path in network and hide the path

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,

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM