Click here to Skip to main content
15,741,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a document library SP 2013 and want to get all the documents from all folders and sub folders. I don't want any folders but I do want to get all the files from each folder.

Using SP 2010 U2U CAML Builder, I have made below query:

<pre lang="xml">
        <ViewAttributes Scope="Recursive" />

This query is working fine with libraries in SP 2010, but it is not working with SP 2013

Below is the code for fetching data from SP 2013 library

CAMLQuery = "<soapenv:Envelope xmlns:soapenv=''>\
    <GetListItems xmlns=''>\
      <listName>My Document Library</listName>\
        <ViewAttributes Scope="Recursive" />\
    </QueryOptions> \

    url: "https://<server>/teams/<siteName>/_vti_bin/lists.asmx",
    type: "POST",
    dataType: "xml",
    data: CAMLQuery,
    complete: getGrid,
    contentType: "text/xml; charset=\"utf-8\""

getGrid is callback function on completion

Please help me with this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900