Sharepoint 2007 - Document Property not saving if the column name is 'Title'

Hi
I have a rather bizarre error in Sharepoint 2007.
I have a web part where I upload a document to a Document Library..
I allow the user to enter in the properties of the document and it all saves up to the Document Library fine.

All the properties get saved except for 'Title'

So the problem is here ....

docProperties["Publication Title"] = tbTitle.Text;
docProperties["Title"] = tbTitle.Text;

When I look at the documents in the document library it will have a value for 'Publication Title' but not for 'Publication'

I have checked the 'internal names' of the columns by sorting the document library by the relevant column ...

So if for example I click on the 'Circulation' column I can see this in the URL ...

...Documents/Forms/AllItems.aspx?SortField=Circulation&SortDir=Asc...

And if I click on the 'Title' column I can see this in the URL ...

...Documents/Forms/AllItems.aspx?SortField=Title&SortDir=Asc...

So it seems I have the correct name for the column 'Title'

Any ideas why it's not saving this one property?
using (SPSite oSite = new SPSite(sharePointSite))
            {
                using (SPWeb oWeb = oSite.OpenWeb())
                {
                    if (System.IO.File.Exists(PDFFileWaitingPath))
                    {
                        SPFolder myLibrary = oWeb.Folders[documentLibraryName];

                        if (myLibrary.UniqueId == null)
                        {
                        }


                        // Prepare to upload 
                        Boolean replaceExistingFiles = true;
                        String fileName = System.IO.Path.GetFileName(PDFFileWaitingPath);
                        FileStream fileStream = File.OpenRead(PDFFileWaitingPath);

                        Hashtable docProperties = new Hashtable();
                        docProperties["Publication Title"] = tbTitle.Text;
                        docProperties["Title"] = tbTitle.Text;
                        docProperties["Category"] = ddlCategory.SelectedIndex + 1;
                        docProperties["Circulation"] = tbCirculation.Text;
                        docProperties["Page"] = tbPage.Text;
                        docProperties["Publication"] = ddlPublication.SelectedIndex + 1;
                        docProperties["Publication Author"] = tbAuthor.Text;
                        docProperties["Publication Date"] = dtcPublicationDate.SelectedDate;
                        docProperties["Posted Date"] = DateTime.Now;
                        docProperties["Summary"] = tbSummary.Text;
                        docProperties["Rank"] = tbRank.Text;

                        // Upload document 
                        SPFile spfile = myLibrary.Files.Add(fileName, fileStream, docProperties, replaceExistingFiles);
                        
                        // Commit  
                        myLibrary.Update();

                        fileStream.Close();

                        // To move a file or folder to a new location:
                        System.IO.File.Move(PDFFileWaitingPath, PDFFilePublishedPath);
                        System.IO.File.Move(XMLFileWaitingPath, XMLFilePublishedPath);

                        
                        


                    }
                    else
                    {
                        throw new FileNotFoundException("File not found.", PDFFileWaitingPath);
                    }
                }
            }

Open in new window

hmcgeehanAsked:
Who is Participating?
 
mo1oneConnect With a Mentor Commented:
Please click on Publication Title and check the name after Sort (similar to what you did for Title). It would have chars like x020 in between Publication and Title instead of space.  Please use that name in code.
 
 
0
 
hmcgeehanAuthor Commented:
...Documents/Forms/AllItems.aspx?SortField=Publication%5fx0020%5fTitle&SortDir=Asc...

But it DOES save the property for 'Publication Title'
It DOESNT save the property for 'Publication'

Thanks
0
 
hmcgeehanAuthor Commented:
And all the other properties with a space in them save fine too ...

docProperties["Publication Author"] = tbAuthor.Text;
                        docProperties["Publication Date"] = dtcPublicationDate.SelectedDate;
                        docProperties["Posted Date"] = DateTime.Now;

The problem is that this one ...

docProperties["Title"] = tbTitle.Text;

Doesn't save (even if there is a value for tbTitle.Text

thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.