Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to upload a file to a document library in sharepoint using CSOM

$
0
0
Hi,

I am getting the below error while trying to upload a file to sharepoint library.

The request message is too big. The server does not allow messages larger than 2097152 bytes.

The below is the code.

var _file = new FileCreationInformation();

_file.Content = ; // some byte array
_file.Overwrite = true;
_file.Url = serverrelativeurl + "/Lists/FaxList/sample.TIF";

Microsoft.SharePoint.Client.File uploadfile = list.RootFolder.Files.Add(_file);
uploadfile.ListItemAllFields["Title"] = "sample";
uploadfile.ListItemAllFields.Update();

Can anyone can help me on this.

Regards,
kiran

Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>