Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For Uploading Document to Sharepoint Document Library use Following function in Client Object Model:</p> <pre><code>public void UploadDocument(string siteURL, string documentListName, string documentListURL, string documentName, byte[] documentStream) { using (ClientContext clientContext = new ClientContext(siteURL)) { //Get Document List List documentsList = clientContext.Web.Lists.GetByTitle(documentListName); var fileCreationInformation = new FileCreationInformation(); //Assign to content byte[] i.e. documentStream fileCreationInformation.Content = documentStream; //Allow owerwrite of document fileCreationInformation.Overwrite = true; //Upload URL fileCreationInformation.Url = siteURL + documentListURL + documentName; Microsoft.SharePoint.Client.File uploadFile = documentsList.RootFolder.Files.Add( fileCreationInformation); //Update the metadata for a field having name "DocType" uploadFile.ListItemAllFields["DocType"] = "Favourites"; uploadFile.ListItemAllFields.Update(); clientContext.ExecuteQuery(); } } </code></pre> <p>Following link is Also Helpful For you 1) <a href="http://blogs.msdn.com/b/sridhara/archive/2010/03/12/uploading-files-using-client-object-model-in-sharepoint-2010.aspx" rel="noreferrer">http://blogs.msdn.com/b/sridhara/archive/2010/03/12/uploading-files-using-client-object-model-in-sharepoint-2010.aspx</a></p> <p>2)<a href="http://msdn.microsoft.com/en-us/library/ee956524.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ee956524.aspx</a></p> <p>3)<a href="http://www.codeproject.com/Articles/103503/How-to-upload-download-a-document-in-SharePoint-20" rel="noreferrer">http://www.codeproject.com/Articles/103503/How-to-upload-download-a-document-in-SharePoint-20</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload