views:

2622

answers:

5

I am sorry to ask you guys such a low-level question, but I really can not find out the answer. Hope some mad dogs will not bark for my question.

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!

+5  A: 

"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.

Rex M
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.
Chris Ballance
Excellent answer, you could have files with the same title but the names have to be unique in one library.
Colin
+2  A: 

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.

Richard C. McGuire
I LEARNED SO MUCH! THANKS YOU.
A: 

Thank you guys very much. How good it is to solve my confusion once in for all. Right now I fond the utility of that so called Sharepoint document auto title. Thanks again!

A: 

i would like to rename the field name into something else,e.g Attached document. can i do that or put a description under uploaded multiple files. i also want to remove the uploaded multiple file options, is it possible. pleae mail me to [email protected]. thanks

fendynovento
A: 

Hi, I have a document library, and when I upload a document over another document (upload document of same name) then the "title" column seems to be getting wierd and unrelated values, and god knows where it pulls that from. Any ideas of similar exp?

Thanks Akash

akash