Upload Forms, VIews to SharePoint using Client Object Model

First thing first, we need to use the namespace, using Microsoft.SharePoint.Client.
byte[] bytes = IO.File.ReadAllBytes(strFilePath);

IO.MemoryStream mStream = new IO.MemoryStream(bytes);

SP.File.SaveBinaryDirect(this.ctx, strServerRelativeUrl, mStream, true);

Remember, SaveBinaryDirect is use to upload Forms, & Views. You can’t upload a ListItem like, Document Library by this process. For other file types, plz check my other blog (will be posting shortly)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s