Monday, July 3, 2017

How to add a Link to a Document external to SharePoint


How to add a Link to a Document external to SharePoint

You can add links to external file shares or/and file server documents to your document library very easily. Why would you want to do this? Primarily so all your MetaData to all your documents are searchable in the same place.

First a Farm Administrator will need to modify a core file on the front end server.  Then you must create a custom Content Type. If you use the built in content type you will not be able to link to a Folder directly.
Edit the NewLink.aspx page to allow the Document Library to accept a File:// entry.

  1. Go to the Front End Web Server \12\template\layouts directory.
  2. Open the file NewLink.aspx using NotePad. If I have to tell you to take a backup of this file first then you have no business editing this file (really).
  3. Go to the end of the script section near top of page and add:
    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;
    }
  4. Use Edit Find to search for HasValidURLPrefix and replace it with HasValidURLPrefix_UNC (you should find it two times).
  5. File – Save.
  6. Open command prompt and enter IISreset /noforce.
Important: To link to Folders correctly you must create your own content type exactly as below and not use the built in URL or Link to Document at all.

Create custom Content Type
  1. Go to your Site Collection logged in as a Site Collection Administrator.
  2. Site actions – Site Settings – Modify All Site Settings.
  3. Content Types
  4. Create
  5. Name = URL or UNC
  6. Description = Use this content type to add a Link column that allows you to put a hyperlink or UNC path to external files, pages or folders. Format is File://\\ServerName\Folder , or http://
  7. Parent Content Type,
    1. Select parent content type from = Document Content Types
    2. Parent Content Type = Link to a Document
  8. Put this site content type into = Existing Group:  Company Custom
  9.  OK
  10. At the Site Content Type: URL or UNC page click on the URL hyperlink column and change it to Optional so that multiple documents being uploaded will not remain checked out.
  11. OK
Add Custom Content Type to Document Library
  1. Go to a Document Library
  2. Settings – Library Settings
  3. Advanced Settings
  4. Allow Management Content Types = Yes
  5. OK
  6. Content Types – Add from existing site content types
  7. Select site content types from: Company Custom
  8. URL or UNC – Add – OK
  9. Click on URL or UNC hyperlink
  10. Click on Add from existing site
  11. Add all your Available Columns – OK
  12. Column Order – change the order to be consistant with the Document content type orders.
  13. Click on your Document Library breadcrumb to test.
  14. View – Modify your view to add the new URL or UNC column to your view next to your Name column.
Create Link to Document
  1. Go to the Document Library
  2. New – URL or UNC
  3. Document Name: This must equal the exact file or folder name less the extension.
    1. Example: Reviews
    2. Example: Folders3
    3. Example: Doc0
  4. Document URL: This must be the UNC path to the folder or file.
    1. Example: http://JKsharepoint.BlogSpot.com/Folder1/Folder2/Reviews.doc
    2. Example: http://JKsharepoint.BlogSpot.com/Folder1/Folder3
    3. Example: File://\\ServerName\FolderName\FolderName2\Doc0.doc
You might see other blogs that say you can't connect to a folder and must create a shortcut first. They are wrong. You can by the method above.

Some common mistakes are:

  1. People use the built in Link to Document content type thinking it is the same or will save them a step. It is not the same.
  2. People click on the NAME field instead of the URL field. They are not the same. You MUST click on the URL field to access the Folder properly.
  3. People type the document extension in the Name field. You can not type the extension in the name field. It will see it is a UNC path and ignore the .aspx extension.
  4. People enter their slashes the wrong direction for UNC paths.
  
HOW TO SHARE FILES AND FOLDERS EXTERNALLY IN SHAREPOINT
https://sharepointmaven.us10.list-manage.com/track/click?u=2151858059c31b8d569544bb7&id=09c3070c9f&e=df6d7ec3a2

No comments:

Post a Comment

Thank you, we will reply soon.