Hello,
Want upload attachment in SharePoint 2013 List Item using CSOM. Created one windows applcation so user can enter the url of site ,list name and ID of list Item in Textbox so to do this so user can browse and upload the file on particular ID. tried the below code:
ClientContext context = new ClientContext("http://sparees"); using (FileStream fs = new FileStream(@"C:\ABC.pptx", FileMode.Open)) { Microsoft.SharePoint.Client.File.SaveBinaryDirect(context, "/documents/ABC.pptx", fs, true);
}