I could see in the Visual Studio Diagnostic Tools window that, the former approach was failing after the download of around 1.5GB of data however, the OpenBinaryStream download was failing after the download of 800-900MB of data only! This is because, MemoryStream uses a byte internally. However, for a 64-bit managed application on a 64-bit Windows operating system, you can create an object of no more than 2GB.įile oFile = web.GetFileByServerRelativeUrl(strServerRelativeURL) ĬlientResult stream = oFile.OpenBinaryStream() Įrror:: Invalid MIME content-length header encountered on read. In this approach, I was trying to download a file, say of size 10GB, in a single. I initially tried the following ways with no success.įileInformation fileInformation = File.OpenBinaryDirect(clientContext, serverRelativeUrl) But, just like I had to rewrite the upload code to accommodate this new limit, file download also needed a complete makeover. I mistakenly, assumed that the previous code for file download will work for the latest larger files as well. The upload operation, as we know, is actually incomplete without download. This is as per the new revised upload limit. In my previous post, I had explained how to upload large files up to 10 GB to SharePoint Online.
0 Comments
Leave a Reply. |