<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Files Archives : Binary Bits</title>
	<atom:link href="https://blog.binarybits.net/tag/files/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.binarybits.net/tag/files/</link>
	<description>Bits &#38; Pieces - A blog by Kannan Balasubramanian</description>
	<lastBuildDate>Fri, 20 Dec 2019 07:33:48 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Get folder and files recursively in SharePoint using REST call</title>
		<link>https://blog.binarybits.net/get-folder-and-files-recursively-in-sharepoint-using-rest-call/</link>
					<comments>https://blog.binarybits.net/get-folder-and-files-recursively-in-sharepoint-using-rest-call/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Tue, 25 Sep 2018 10:14:22 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Files]]></category>
		<category><![CDATA[Folders]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[REST]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=988</guid>

					<description><![CDATA[<p>There was a simple requirement I came across for which a page should list all the files and folders in a SharePoint document library. I came up with a solution using ODATA call. Following is the REST call I made to get the list of all folder and files. /_api/web/Lists/GetByTitle(&#8216;Documents&#8217;)/Items?$select=FileLeafRef,FileRef&#38;$orderby=FileRef asc Following is the code [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/get-folder-and-files-recursively-in-sharepoint-using-rest-call/">Get folder and files recursively in SharePoint using REST call</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">There was a simple requirement I came across for which a page should list all the files and folders in a SharePoint document library.</p>



<p class="wp-block-paragraph">I came up with a solution using ODATA call. Following is the REST call I made to get the list of all folder and files.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>/_api/web/Lists/GetByTitle(&#8216;Documents&#8217;)/Items?$select=FileLeafRef,FileRef&amp;$orderby=FileRef asc</p></blockquote>



<p class="wp-block-paragraph">Following is the code which quickly prints them out in a table. Just add this code to a script editor web-part.<br>
Please make sure the URL is updated based on your site URL.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}">&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    $.ajax({
        url: &quot;&lt;site url&gt;/_api/web/Lists/GetByTitle('Documents')/Items?$select=FileLeafRef,FileRef&amp;$orderby=FileRef asc&quot;,
        type: &quot;GET&quot;,
        headers: {
            &quot;Accept&quot;: &quot;application/json;odata=verbose&quot;
        },
        success: function (data, textStatus, xhr)
        {
            $.each(data.d.results, function (index, item)
            {
                // alert(&quot;The items in list are : &quot; + item.FileRef);
                $(&quot;#table1 tbody&quot;).append(&quot;&lt;tr&gt;&lt;td&gt;&quot; + item.FileRef + &quot;&lt;/td&gt;&lt;/tr&gt;&quot;);
            })
        },
        error: function r(xhr, textStatus, errorThrown)
        {
            alert(&quot;error:&quot; + JSON.stringify(xhr));
        }
    });
&lt;/script&gt;

&lt;table id=&quot;table1&quot;&gt;
    &lt;tbody&gt;&lt;/tbody&gt;
&lt;/table&gt;</pre></div>
<p>The post <a href="https://blog.binarybits.net/get-folder-and-files-recursively-in-sharepoint-using-rest-call/">Get folder and files recursively in SharePoint using REST call</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/get-folder-and-files-recursively-in-sharepoint-using-rest-call/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.binarybits.net @ 2026-05-31 15:35:11 by W3 Total Cache
-->