0

We have a SharePoint 2010 intranet that shows images from a unc path. I use an img tag like the following:

<img width="50px" height="25px" src="file://ShareName/Folder/image.jpg">

The problem is that it works fine in IE but not in Chrome or Firefox. I did some googling and it said try using file:///// in place of file://. This doesn't work either. It makes me believe it's a security issue of some type. Chrome/Firefox don't allow local files to show?

Has anyone run into this before? If so, how can I resolve this issue?

0

1 Answer 1

0

Why are you using UNC path?

You can use layouts or hive folder of SharePoint instead, just copy your images/CSS/JS stuff in a separate folder here:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS

and than refer to the files in your solution as, for example:

<img width="50px" height="25px" src="/_layouts/folderName/imageFile.jpg">

CAN'T PUT FILES TO LAYOUTS FOLDER

In this case, you should put your files in a document library (most commonly Style Library / Style Assets).. And reference the files using relative URLs like:

/Style Library/ImagesFolder/logo.jpg

If you are using Publishing Template, you have Images library (Publishing Image Library).. You can put your files in that library.

References:

How to use relative URL for image in Master Page?

2
  • Thank you Arsalan. You got me going on the right track. This folder is maintained by another dept so copying it the the layouts folder was not an option. <br /> Since it's an internal intranet, I choose to make a virtual directory(VD) from the site in IIS. The VD has the UNC location as it's path. This way I was able to use a link such as /FolderName/ImageFile.jpg.
    – user29567
    Jun 12, 2014 at 14:53
  • Please check the update.. Jun 12, 2014 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.