I can't seem to upload a file to SharePoint if that file exceeds 2MB or so. I am developing a Silverlight application that is interacting with SharePoint via Managed Client Object Model for Silverlight (Microsoft.SharePoint.Client.Silverlight).
I've read around that the proper file uploading from Client Object Model should be done like so:
Microsoft.SharePoint.Client.File.SaveBinaryDirect(clientContext,
targetUrl, fileStream, true);
However, I cannot use the SaveBinaryDirect(...)
method because it doesn't exist in the Microsoft.SharePoint.Client.Silverlight
assembly.
Right now, I am using this (that's the code that doesn't cope well with +2MB files):
FileCreationInformation fci = new FileCreationInformation();
...
File file = this.list.RootFolder.Files.Add(fci);
Can you help me? Thanks.