Gaby, I have the same behavior for docx and xlsx files.
After loading the document, if the file is of type docx or xlsx, I call sp webservice to update the metadata.
This is the code immediately after a successful file upload:
int extlength = 0; extlength = documentName.Length - documentName.LastIndexOf(".") - 1; string docext = documentName.Substring(documentName.LastIndexOf(".") + 1, extlength); if (docext == "xlsx" || docext == "docx") { string doclookupname = metaInfo["PermitApplicationID"].ToString() + "_" + metaInfo["Title"].ToString(); UpdateMetaData("Shared Documents", "1", doclookupname, "PermitApplicationID", metaInfo["PermitApplicationID"].ToString()); UpdateMetaData("Shared Documents", "1", doclookupname, "DocumentCategories", metaInfo["DocumentCategories"].ToString()); UpdateMetaData("Shared Documents", "1", doclookupname, "Title", metaInfo["Title"].ToString()); }
This is the function that the above code calls to update metadata using the sp list service. I call this function for each metadata value that I want to update.
private static void UpdateMetaData(string strListName, string rowLimit, string strDocTitle, string FieldName, string NewValue) { Lists_WinAuth.Lists li = new Lists_WinAuth.Lists(); li.Credentials = new NetworkCredential("yourUserID", "YourPwd", "YourDomain"); XmlDocument xmlDoc = new System.Xml.XmlDocument();
source share