1

I try to upload file to document library with metadata. When I enter validation for one column the file does not upload even data is correct or incorrect. Always show this exception

List data validation failed

My Code Is

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();
}
  • 1
    Can you add details of validation. – Amal Hashim Jun 7 '15 at 12:39
  • please check it is related to your column validation or can you please tell what type of validation you are using (date time etc...) – Ankur Jun 8 '15 at 18:24
  • same issue here with list validation in place: if the rule is there then the upload always fail, even if metadata is correct. – Paolo Sep 3 '15 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.