Sharepoint 2010 - Object Model - Download DocumentSet Programmatically -


a code snippet of how can download documentset programmatically using sharepoint object model help.

what trying - given sharepoint site, log in user default credentials - document library files hosted - pull files down on local machine

what have done far,

using microsoft.sharepoint.client;  clientcontext cc = new clientcontext(configurationmanager.appsettings["site"]);             cc.credentials = new networkcredential(username, pwd, domain);             web site = cc.web;             listcollection colllist = site.lists;              var olist = colllist.getbytitle("document set test");              // document set             cc.load(olist);             cc.executequery();              // views             var views = olist.views;             cc.load(views);             cc.executequery();              // documents             camlquery camlquery = new camlquery();             camlquery.viewxml = @"<query>                                    <viewfields>                                         <fieldref name='title'/>                                         <fieldref name='display name'/>                                    </viewfields>                                    <where>                                       <gt>                                          <fieldref name='created' />                                          <value includetimevalue='true' type='datetime'>1900-05-08t14:25:50z</value>                                       </gt>                                    </where>                                       <orderby>                                          <fieldref name='title' ascending='true' />                                    </orderby>                                                                     </query>";              var docs = olist.getitems(camlquery);             cc.load(docs);             cc.executequery();              console.writeline(string.format("{0} models in repository", docs.count)); 

foreach (var doc in docs) {

// download documents in document set - how?

                console.writeline(string.format("{0} => {1} ", environment.newline, doc["title"]));             }             console.writeline(environment.newline); 

you interested in microsoft.sharepoint.client.file.openbinarydirect method. returns fileinformation makes content accessible via stream property. can have @ code examples in other thread here, on an msdn page or in a codeproject article.

and yes, there sharepoint developers on stackoverflow :-)

--- ferda


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -