我尝试使用元数据将文件上传到文档库。当我为一列输入验证时,即使数据正确或不正确,文件也不会上传。始终显示此异常
列表数据验证失败
我的代码
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();
}