Add a link to an external file share Path to SharePoint document library

Basically SharePoint support only http:// and https://. Now if I want to link like external file share like UNC path start from file://servername /folder.

Using OOB feature is not able to do, so for this functionality follow these steps –

1. We need to edit the NewLink.aspx page to allow the document library to accept a file:// url.

2. Go to this “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS” directory and find newlink.aspx.

3. Now copy newlink.aspx and take a backup, before any changes. Now open this file in any editor.

4. Go to the end of the script section and add the following code. See in fig:

function HasValidUrlPrefix_UNC(url)
 {
 var urlLower=url.toLowerCase();
 if (-1==urlLower.search(”^http://”) && -1==urlLower.search(”^https://”) && -1==urlLower.search(”^file://”))
 return false;
 return true;
 }
Add a link to an external file share Path to SharePoint document library
Step to add a link to an external file share UNC Path to SharePoint 2010 document library

5. Now find HasValidUrlPrefix and replace it with HasValidUrlPrefix_UNC (you should find it two times)

6. Save this file.

7. Now open a command prompt and enter IISreset /no force

8. Now add the link in your page and give the url of your external file share (UNC Path) and save it. Now you able to access the file share directory, I entered the url \\cjs01\Learning Resource. See in fig

Add a link to an external file share Path to SharePoint document library
Step to add a link to an external file share UNC Path to SharePoint 2013 document library

You may like following SharePoint tutorials:

This SharePoint tutorial we learned, how to add a link to an external file share Path to SharePoint document library.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>