Step to add a link to an external file share UNC Path to SharePoint 2010 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.


Also you can check out:

Rename default Name column in SharePoint 2010 document library

Add Custom Actions to List Item Menu in SharePoint 2010 Using SharePoint Designer 2010

Provider Hosted App in SharePoint Online using Visual Studio 2017 + Deploy Provider Hosted Add-in to Microsoft Azure

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

1. We need 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;
}

 Step to add a link to an external file share UNC Path to SharePoint 2010 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

 Step to add a link to an external file share UNC Path to SharePoint 2013 document library
Step to add a link to an external file share UNC Path to SharePoint 2013 document library
Check out Best Alternative to InfoPath -> Try Now

You May Also like the Following SharePoint Online Tutorials:

About Navneet Singh

I am Navneet Singh, Working at C3it software solutions pvt. ltd. in Pune. My core skills are SharePoint 2013, Office 365, SharePoint 2010, SharePoint Designer, SharePoint Designer Workflow, Nintex Workflow, Infopath, Webpart, CSOM/SSOM, Power-shell, C#, ASP.NET and SQL Server.

View all posts by Navneet Singh →