You are hereAdding a Link to a SharePoint Document Library


Adding a Link to a SharePoint Document Library


By hagrin - Posted on 03 March 2009

Updated - 13 November 2009 - I have updated this post to improve on the JavaScript listed below so that the Back Button works properly.

Recently, a client wondered how they could add an external document to a document library that existed on their Intranet. The problem with just saving their document and uploading it to the Intranet is a matter of document "freshness" as changes are made by the document owner. Therefore, creating an external link to that document is a much better solution. However, adding a link to a document library would seem difficult on its face.

To get around this issue, I took the following steps -

1. Create a TXT file.
2. Open the TXT file and add the following HTML -

<html>
<head>
<title>External Link</title>
<script type="text/javascript">
window.self.location.replace('http://www.somesite.com');
</script>
</head>
<body>
</body>
</html>

3. Save the file as a HTML file.
4. Upload to your Document Library.

You now have a working JavaScript redirection to the external document in your document library. Also, you can click the Back Button in your browser and you will return back to your Document Library.