Adding a Link to a SharePoint Document Library

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.

It worked

It works,

thank you very much for your help.

Thanks,
mohan

Thanks!

It works! Thanks so much. I can now create a re-orged sub-site consisting of pointers to the tragic (but will be hidden) folders and files.

I have to reorganize a

I have to reorganize a Sharepoint site that is organized like a rat's nest. Meanwhile, the development files can't be moved because they are using special templates with back-end software that links all their files together.

I could use this code to create a document library front end to reorganize the way files are displayed without actually changing the real file structure.

However, the back button doesn't work. Is there a way to add referrer code to the javascript in the HTML file so that the back button works?

thanks a lot! it works

thanks a lot! it works perfect!

Back Button

Great question.

I have updated the post with some JavaScript that keeps the Back Button functioning properly. Good luck and thanks for posting.