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

Uploading bigger files using CSOM

$
0
0

Hi,

whenever i try to use this code

var myFile = new FileCreationInformation();
myFile.ContentStream = doc.ContentStream;
            using (ClientContext ctx = TokenHelper.GetClientContextWithAccessToken((string)request.Properties[hW], (string)request.Properties[aT]))
            {
                Folder destionationFolder = ctx.Web.GetFolderByServerRelativeUrl(destinationPath);
                ctx.Load(destionationFolder);
                ctx.ExecuteQuery();

                File uploadedFile = destionationFolder.Files.Add(myFile);
                ctx.Load(uploadedFile);
                ctx.ExecuteQuery();
            }

 I get the following error message:

"Specified argument was out of the range of valid values.\r\nParameter name: bytesToCopy"

Maybe there is another way to upload a file which is bigger than 2MB using the CSOM in combination with OAuth (SharePoint 2013/Office365?

best regards

Joerg



Viewing all articles
Browse latest Browse all 25064

Trending Articles



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