سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top