I am trying to answer a business question that requires us to provide links to files in SharePoint 2010. The names and metadata of these files may change over time so we can't use these in the links we provide.

Is there any other "unique file reference" that can be used to access a file that will always work regardless of any changes to the file's name or metadata.

  • Please read our FAQ on how to tag (e.g. tag by feature not by version). If a tag you'd like to use is missing, simply flag a moderator. – Alex Angas Jun 28 '11 at 23:48

You could use the Document ID Service that will uniquely identify a document. This will generate a unique identifier for the document and give it a distinct URL, from the referenced blog post, it'll look like, http://sitecollectionurl/_layouts/DocIdRedir.aspx?ID=MFSHF5F7ZUF5-1-1.


Yes - you can use the file's GUID. Retrieve the GUID of an existing file using SPFile.UniqueId and open the file using SPSite.OpenFile(GUID).


Are these documents stored in a document library? The list entry ID will never change, no matter how many times you change the name, meta data, etc. So you can always use a link such as http://sitecollection/library/forms/dispform.aspx?id={0} to show the "View Properties" screen for any file; there people can view the meta data and/or open the file.


I prefer @webdes03 answer as it is the easiest solution. However, you may also want to have a look at third party URL Shorteners for SharePoint. This can work very well, especially in combination with workflows.

I have conveniently included the link to one that I worked on :-) But other ones are available as well, not sure if the others work on SP2010.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.