Sharepoint 2013客户端文档库列验证

时间:2015-06-07 07:54:05

标签: c# list validation sharepoint sharepointdocumentlibrary

我尝试使用元数据将文件上传到文档库。当我为一列输入验证时,即使数据正确或不正确,文件也不会上传。始终显示此异常

  

列表数据验证失败

我的代码

if (documentsList.BaseType == BaseType.DocumentLibrary)
{   
    Folder DocLib = documentsList.RootFolder;

    FileCreationInformation DocItemInfo = new FileCreationInformation();
    DocItemInfo.ContentStream = GetImageFile();
    DocItemInfo.Overwrite = true;

    DocItemInfo.Url = "Test.JPG";
    Microsoft.SharePoint.Client.File file = DocLib.Files.Add(DocItemInfo);

    ListItem newItem = file.ListItemAllFields;

    FillSPLitem(ref newItem); // To get MetaData

    newItem.Update();

    clientContext.ExecuteQuery();
}

0 个答案:

没有答案