The Difference between Sharepoint Document Title and Document Name

26,153

Solution 1

"Title" is a field on the entity in the database. "Name" is what uniquely identifies the SPFile underlying the document. So you can think of Title as pretty arbitrary; you can change it just like you would change any other property (description, etc.) but if you change the Name, it is akin to moving the file. Names must be unique in folders/webs.

Solution 2

From the properties of SPFile on MSDN:

  • Name: Gets the name of the file including the extension.
  • Title: Gets the display name of the file.

When uploading a document by default the 'Name' property will equal the file name of the document. For example if I upload MyDocument.docx then the 'Name' property will equal MyDocument.docx. The name property works the same as a file name typically does, if I have a site at http://myserver.com/MyWeb/default.aspx and the file is stored in a document library called 'MyDocuments' then I would be able to access the file at http://myserver.com/MyWeb/MyDocuments/MyDocument.docx. If I change the name to NewDocument.docx then I would access the file at http://myserver.com/MyWeb/MyDocuments/NewDocument.docx.

The 'Title' property is just extra metadata assigned to the document. In the case of the above someone might be inclined to avoid using spaces in the filenames of their document, but with the title field they can be free to add them in. It would increase readability and still allow for any filename restrictions.

In the case of your colleague he might be wishing to avoid certain characters or formatting in the file name - or just simple doesn't want to rename it on the users - and so he is modifying the title (metadata) rather than the file itself.

Share:
26,153
Michiel van Oosterhout
Author by

Michiel van Oosterhout

I ♥ code

Updated on August 24, 2022

Comments

  • Michiel van Oosterhout
    Michiel van Oosterhout over 1 year

    A colleague of mine developed a workflow which auto set title to document. With this workflow,as he put it, he can optimize the research and lookup things like that. However I think it can be done just by name of document. There are must be some kind of story behind this. Could someone help me here? Thanks!

  • Chris Ballance
    Chris Ballance over 15 years
    Rex is correct here. "Title" can be used as the exposed name and "Name" can be more of an internal unique identifier. It's safer to let editors change the "Title" on a document than exposing the "Name" attribute to them.
  • Colin
    Colin almost 15 years
    Excellent answer, you could have files with the same title but the names have to be unique in one library.