<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ dropbox - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ dropbox - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sun, 17 May 2026 22:29:03 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/dropbox/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Send Large Video Files – Share a Big File with Email ]]>
                </title>
                <description>
                    <![CDATA[ Sending large files through email can be quite challenging. This is because each email client has a size limit for file sharing. Gmail and Yahoo limit file size to 25MB, while outlook and iCloud limit files to 20MB. So, if you decide to send, for exa... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-send-large-video-files-share-a-big-file-with-email/</link>
                <guid isPermaLink="false">66adf1476f5e63db3fc4361e</guid>
                
                    <category>
                        <![CDATA[ dropbox ]]>
                    </category>
                
                    <category>
                        <![CDATA[ email ]]>
                    </category>
                
                    <category>
                        <![CDATA[ File sharing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Google Docs ]]>
                    </category>
                
                    <category>
                        <![CDATA[ videos ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Wed, 27 Apr 2022 19:51:49 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/technology-2125547_1280.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Sending large files through email can be quite challenging. This is because each email client has a size limit for file sharing.</p>
<p>Gmail and Yahoo limit file size to 25MB, while outlook and iCloud limit files to 20MB.</p>
<p>So, if you decide to send, for example, a video file larger than 25MB, you might get an error that the message was rejected by the server because it’s too large.</p>
<p>Some email clients won’t show an error, but instead, suggest how you should send the large video file. </p>
<p>For example, Gmail will suggest that you upload the video to Google Drive: 
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss1-7.png" alt="ss1-7" width="600" height="400" loading="lazy"></p>
<p>And Outlook will suggest that you upload the video to Microsoft OneDrive:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss2-8.png" alt="ss2-8" width="600" height="400" loading="lazy"></p>
<p>How then do you send a large video file through email? That’s what I’m going to show you in this article.</p>
<h2 id="heading-how-to-send-large-video-files-through-email-using-google-drive">How to Send Large Video Files through Email Using Google Drive</h2>
<p>Google Drive is a cloud-based storage service provided by Google for sharing files.</p>
<p>As already shown in this article, Gmail prompts you to upload a video file larger than 25MB to Google Drive and then convert the video to an accessible link.</p>
<p>If you are using another email client like Outlook, or Yahoo, you can still send the large video using Google Drive.</p>
<p>Upload the video to your Google Drive and click the “Get link” button:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss3-7.png" alt="ss3-7" width="600" height="400" loading="lazy"></p>
<p>Change the access from restricted to “Anyone with the link”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss4-5.png" alt="ss4-5" width="600" height="400" loading="lazy"></p>
<p>Click “Copy link”, and then “Done”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss5-5.png" alt="ss5-5" width="600" height="400" loading="lazy"></p>
<p>Click “Compose” and paste the link to your email editor. Provide every other necessary detail and click the “Send” button:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss6-5.png" alt="ss6-5" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-send-large-video-files-through-email-using-dropbox">How to Send Large Video Files through Email Using Dropbox</h2>
<p>Dropbox is another cloud-based storage service that lets you back up and sync files on multiple devices. You can upload up to 50GB file size to your Dropbox account if you have one.</p>
<p>To send large video files through email by using Dropbox, upload the video to your Dropbox account and copy the link:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss7-4.png" alt="ss7-4" width="600" height="400" loading="lazy"></p>
<p>Compose your email and paste the link in to send the large video file:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss8-4.png" alt="ss8-4" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-send-large-video-files-through-email-using-video-sharing-services">How to Send Large Video Files through Email Using Video Sharing Services</h2>
<p>You can send large video files through email by using video-sharing services like YouTube and Vimeo.</p>
<p>And yes, you can upload videos to YouTube without having a YouTube channel. As long as you have a Gmail account, you have access to Google services, including YouTube. So if you have a Google account, technically you can have a YouTube channel.</p>
<p>To upload videos to YouTube, click the Create button on the top-right corner and select “Upload video”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss9-4.png" alt="ss9-4" width="600" height="400" loading="lazy"></p>
<p>Click on “SELECT FILES” to choose the file on your device:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss10-4.png" alt="ss10-4" width="600" height="400" loading="lazy"></p>
<p>Give the video a name and description, copy the link, and click “Next”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss11-3.png" alt="ss11-3" width="600" height="400" loading="lazy"></p>
<p>Follow other prompts and choose whether you want to make the video public or private, then click “Save”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss12-2.png" alt="ss12-2" width="600" height="400" loading="lazy"></p>
<p>Head over to your email client composer and paste in the link so you can send the large video file:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss13-1.png" alt="ss13-1" width="600" height="400" loading="lazy"></p>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>You can’t send a large video file directly through email clients, but you can take advantage of the methods discussed in this article to send large video files.</p>
<p>Another way you can send a large video file through email is to compress the video through your native compressor or third-party file compressors. As long as the file is less than 20-25MB, you can send it through email.</p>
<p>But if you compress the video and it is still not less than 20-25MB, then you should use any of the methods pointed out in this article.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to create an expense organizer with JavaScript in 10 minutes ]]>
                </title>
                <description>
                    <![CDATA[ By Per Harald Borgen Let’s use ES6 and the Dropbox API to keep our receipts from turning into chaos. In this article, I’ll show you how to create a handy little app which keeps track of your receipts. It allows you to dump all your receipts into a D... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-create-an-expense-organizer-with-javascript-in-10-minutes-d6dd3541ab5e/</link>
                <guid isPermaLink="false">66c35125f41767c3c96bad0e</guid>
                
                    <category>
                        <![CDATA[ dropbox ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ES6 ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Front-end Development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 14 May 2019 19:16:06 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*YBax0a_iWxVNx3d6cEPdDQ.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Per Harald Borgen</p>
<h4 id="heading-lets-use-es6-and-the-dropbox-api-to-keep-our-receipts-from-turning-into-chaos">Let’s use ES6 and the Dropbox API to keep our receipts from turning into chaos.</h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/8wK59ea3CJIUcrFu6EXhbWZBcEXSCTQFW6I3" alt="Image" width="600" height="400" loading="lazy"></p>
<p>In this article, I’ll show you how to create a handy little app which keeps track of your receipts. It allows you to dump all your receipts into a Dropbox folder and then hit a button to organize them by month.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Learn to use the Dropbox API by creating an expense organizer ]]>
                </title>
                <description>
                    <![CDATA[ Learn how to build an expense organizer with the Dropbox API and JavaScript ES6!  Dropbox is a content and collaboration platform. It's API allows you to add Dropbox features to your apps, such as file storage, sharing, previews, and search. In this ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/dropbox-api-tutorial/</link>
                <guid isPermaLink="false">66b2022527569435a9255aab</guid>
                
                    <category>
                        <![CDATA[ dropbox ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Tue, 09 Apr 2019 14:00:02 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/ghost/2019/04/dropbox.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Learn how to build an expense organizer with the Dropbox API and JavaScript ES6! </p>
<p>Dropbox is a content and collaboration platform. It's API allows you to add Dropbox features to your apps, such as file storage, sharing, previews, and search.</p>
<p>In this video course, Christian Jensen uses Scrima.com to demonstrate how to build an organizer app while teaching the fundamentals of working with the Dropbox API. You will also learn several ES6 concepts, like array methods and async/await functions. </p>
<p>You can watch the full video course on the <a target="_blank" href="https://youtu.be/AzCQrjWQJs4">freeCodeCamp.org YouTube channel</a> (1 hour watch).</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Free Course: Build an  expense organizer with ES6 and Dropbox ]]>
                </title>
                <description>
                    <![CDATA[ By Per Harald Borgen In my previous startup, we used the Dropbox API heavily in our production process. Our products were children’s book apps for iPad, and each book was simply a collection of Dropbox folders containing all the visuals, music and vo... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/free-course-build-an-expense-organizer-with-es6-and-dropbox-4ec7cd1048ef/</link>
                <guid isPermaLink="false">66d85209e0db794d56c01c03</guid>
                
                    <category>
                        <![CDATA[ dropbox ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Front-end Development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 27 Mar 2019 18:37:32 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*e-tlgkX_3RVuHm5CRth_tA.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Per Harald Borgen</p>
<p>In my previous startup, we used the Dropbox API heavily in our production process. Our products were children’s book apps for iPad, and each book was simply a collection of Dropbox folders containing all the visuals, music and voice-overs for the book. This had two big benefits: it provided everyone with an interface they already knew how to use, and it was cheaper than building a custom interface.</p>
<p>So when Dropbox asked Scrimba whether we’d be interested in creating a sponsored course on their API, there was no doubt in our minds, as we knew how useful their API can be.</p>
<p>Secondly, this sponsorship also allows us to create even more courses for our community throughout 2019. So we’re very thankful for Dropbox being interested in supporting Scrimba.</p>
<p>Now let’s have a look at <a target="_blank" href="https://scrimba.com/g/gdropbox?utm_source=freecodecamp.org&amp;utm_medium=referral&amp;utm_campaign=gdropbox_launch_article">the actual course.</a></p>
<h3 id="heading-intro">Intro</h3>
<p>The instructor of this course is <a target="_blank" href="https://twitter.com/cbejensen">Christian Jensen</a>, a front-end developer based in Utah. Some of you might know him from the React Hooks tutorials he created on Scrimba last year, and which a lot of people enjoyed.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*V4RAOA69TS3rFbjT5kqK2g.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Christian starts off the course by giving you an overview of what you should know before you start, and what you can expect to learn throughout the course.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*E5solf68782pbf9pTyNozA.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>As prerequisites for the course, it would be good to know, but not necessary, some basic HTML and JavaScript. If you’re not really familiar with JS, you can still follow along with this course, as the API translates really well into other languages.</p>
<p>The end goal of the course is to make you capable of building an app on top of Dropbox folders, exemplified with the expense organizer app which Christian builds throughout the lessons.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*_x-1lvglq1tezlSP1SUQAg.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>It’s a perfect example of something which is a lot of pain for many companies and freelancers, namely keeping track of receipts!</p>
<h3 id="heading-set-up">Set Up</h3>
<p>Before we dive into the code, Christian gives us a brief, optional, overview of the setup for those who wish to run the app in this tutorial on their own.</p>
<p>The first thing you need to do is <a target="_blank" href="https://www.dropbox.com/developers">head to Dropbox.</a> On the Dropbox website, go to <strong><em>My apps</em></strong> and choose <strong><em>Dropbox API</em></strong>:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*AEdK8mMCUAFzP-ad5tvDaw.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Next, we choose <strong><em>App folder</em></strong> access type, just to see how it works, and lastly, we will name our app.</p>
<p>After we hit the <strong><em>Create app</em></strong> button and after our app is generated, we see the settings screen.</p>
<p>In the settings, we really need only the <strong><em>OAuth 2</em></strong> section and under <strong><em>Generated Access Token</em></strong>, click <strong><em>Generate</em></strong> button to get an access token we will use in the next part of our tutorial.</p>
<p>That’s all!</p>
<h3 id="heading-import-the-sdk">Import the SDK</h3>
<p>In this cast, Christian shows us how to import the SDK and start using it.</p>
<p>A quick side note: even though in this course JavaScript SDK for Dropbox API is used, the SDK itself is basically the same across the programming languages.</p>
<p>Let’s begin with importing the JavaScript SDK.</p>
<pre><code class="lang-js"><span class="hljs-comment">// note that the import is named  </span>
<span class="hljs-keyword">import</span> { Dropbox } <span class="hljs-keyword">from</span> <span class="hljs-string">'dropbox'</span>;
</code></pre>
<p>The class is instantiated with a configuration object, that needs <code>accessToken</code> and a fetching library. We will be using plain <code>fetch</code> in the course and you can get your <code>accessToken</code>, if you wish, in your Dropbox Developer Account.</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> { Dropbox } <span class="hljs-keyword">from</span> <span class="hljs-string">'dropbox'</span>;

<span class="hljs-keyword">const</span> dbx = <span class="hljs-keyword">new</span> Dropbox({  
  <span class="hljs-attr">accessToken</span>: <span class="hljs-string">'aeOL1E1HS0AAAAAAAAAALX6z1ogWy75HGE_HBN-NNpJNfhnEa1kjF1vsJ_t7Wf8k'</span>, 
  fetch  
})
</code></pre>
<p>Note: the <code>accessToken</code> above has been revoked, so it’s no point trying to use it in your own code.</p>
<h3 id="heading-get-files">Get Files</h3>
<p>So far, Christian showed us how to instantiate a class.</p>
<p>A full list of methods on the class can be found at <a target="_blank" href="https://dropbox.github.io/dropbox-sdk-js/Dropbox.html">the official docs page</a>.</p>
<p>In this cast, we will learn about the <code>filesListFolder()</code> method. It accepts a folder and _s_tarts returning the contents of the folder.</p>
<pre><code class="lang-js">dbx.filesListFolder({  
  <span class="hljs-attr">path</span>: <span class="hljs-string">''</span>  
}).then(<span class="hljs-function"><span class="hljs-params">res</span> =&gt;</span> <span class="hljs-built_in">console</span>.log(res))

<span class="hljs-comment">// for a full console.log results, visit:  </span>
<span class="hljs-comment">// [https://scrimba.com/p/pnyeEhr/cGvvanuy](https://scrimba.com/p/pnyeEhr/cGvvanuy)</span>
</code></pre>
<p>There are a few things to keep in mind when we use <code>filesListFolder()</code>:</p>
<ul>
<li>it returns a promise.</li>
<li>to specify a root path we need to specify an empty string <code>''</code> and not <code>'/'</code></li>
</ul>
<h3 id="heading-render-files">Render Files</h3>
<p>In this lesson, Christian will show us how to render files that we get from <code>filesListFolder()</code> from the previous cast. He’ll provide us with some boilerplate vanilla JS code to get us started, so we can focus on the most interesting part of this lesson — rendering files.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*ej_T0WlW-8dYdh-jtfnrdg.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Let’s write the <code>renderFiles()</code> function, together with Christian.</p>
<p>We need to add to <code>fileListElem.innerHTML</code> all the alphabetically sorted files, making sure that we put folders first. We then map every folder and file to a <code>&lt;li&gt;</code> and join using <code>join('')</code> to avoid rendering an array instead of a string.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*jdGqIdyndF809yZP8HVb0Q.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>And there we go, our rendered files list!</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*pf1rF4OQIMIOsnrMGefL6w.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-render-thumbnails">Render Thumbnails</h3>
<p>In this screencast, Cristian is going concentrate on rendering the thumbnails and we will look into getting actual thumbnails from Dropbox in the following lesson.</p>
<p>We’re going to modify our <code>renderFiles()</code> function. In the <code>.map</code> part, we can check if the thumbnail exists for a file and then use it, otherwise, use a default. Keep in mind that folders don’t have thumbnails.</p>
<p>The default images will be provided as base64 strings, and if you follow along with the course in your own editor, <a target="_blank" href="https://scrimba.com/p/pnyeEhr/ckMP6DTN?utm_source=freecodecamp.org&amp;utm_medium=referral&amp;utm_campaign=gdropbox_launch_article">you can visit the cast to copy them</a>.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*KqXU3cTOh2nPjM2ZhuKBgw.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Great, now we have default thumbnails rendered and in the next cast Christian is going to show us how to render actual thumbnails that we can get from Dropbox API.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*m6HDdcAVA7de0O2G_FN7CQ.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-get-thumbnails">Get Thumbnails</h3>
<p>As Christian promised in the last lesson, we’re now going to render actual thumbnails we can get from Dropbox API for the files that have them.</p>
<p>We’re going to add and then create <code>getThumbnails()</code> to our <code>updateFiles()</code>method.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> updateFiles = <span class="hljs-function"><span class="hljs-params">files</span> =&gt;</span> {  
  state.files = [...state.files, ...files]  
  renderFiles()  
  getThumbnails(files)  
}
</code></pre>
<p>To get thumbnails we can use an existing API endpoint:</p>
<pre><code class="lang-js"><span class="hljs-comment">// [http://dropbox.github.io/dropbox-sdk-js/Dropbox.html](http://dropbox.github.io/dropbox-sdk-js/Dropbox.html)</span>

dbx.filesGetThumbnailBatch({  
  <span class="hljs-attr">entries</span>: [{  
    <span class="hljs-attr">path</span>: <span class="hljs-string">''</span>,  
    <span class="hljs-comment">// preferred size for a thumbnail  </span>
    <span class="hljs-attr">size</span>: <span class="hljs-string">'w32h32'</span>  
  }]  
})
</code></pre>
<p>And this is the finished <code>getThumbnails()</code> function:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*J2wKfqbHgBRZeXh9HCWoag.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>If you’re interested in a detailed walkthrough or wish to copy the code, feel free to jump into <a target="_blank" href="https://scrimba.com/p/pnyeEhr/cyNpzJAe?utm_source=freecodecamp.org&amp;utm_medium=referral&amp;utm_campaign=gdropbox_launch_article">the actual cast</a>.</p>
<h3 id="heading-async-await">Async / Await</h3>
<p>So far we’ve used two API calls that return promises. We’ve been resolving them using <code>.then()</code> and in this screencast, Christian is going to show us how we can refactor them using <code>async/await</code>.</p>
<p>To use <code>async/await</code> we declare <code>async</code> in front of our function and <code>await</code> before our API call.</p>
<p>Let’s look at how we can refactor our <code>init()</code> function.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> init = <span class="hljs-keyword">async</span> () =&gt; {  
  <span class="hljs-keyword">const</span> res = <span class="hljs-keyword">await</span> dbx.filesListFolder({  
    <span class="hljs-attr">path</span>: <span class="hljs-string">''</span>,  
    <span class="hljs-attr">limit</span>: <span class="hljs-number">20</span>  
  })  
  updateFiles(res.entries)  
}
</code></pre>
<p>And now let’s refactor <code>getThumbnail()</code>:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*yAvMbGfaT4c-g4Ir-eYtMA.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-the-cursor">The Cursor</h3>
<p>In this cast, we’re going to learn about Dropbox’s concept of the cursor.</p>
<p>In plain API terms, the cursor is an indication of where we are among our files.</p>
<p>For example, you have 100 files, and you requested the first 20. The cursor will move to the 21st file and will let you know that you have more files to download via <code>has_more: true</code> field. The more files you request, the further the cursor goes until it tells you that there are no more files left by <code>has_more: false</code>.</p>
<p>This is what it would look like in reality.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*pzE5UO7M7OlYYFjJkXwoaQ.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can use the cursor string to let the API know where the cursor is, so you don’t receive the files that you already have.</p>
<p>In the next lesson, Christian will show us how we can apply this concept to our app and use the cursor to get more files.</p>
<h3 id="heading-get-more-files">Get More Files</h3>
<p>Let’s update <code>init()</code> method to load further files if there are any, by checking <code>has_more</code> property on our response.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> init = <span class="hljs-keyword">async</span> () =&gt; {  
  <span class="hljs-keyword">const</span> res = <span class="hljs-keyword">await</span> dbx.filesListFolder({  
    <span class="hljs-attr">path</span>: <span class="hljs-string">''</span>,  
    <span class="hljs-attr">limit</span>: <span class="hljs-number">20</span>  
  })  
  updateFiles(res.entries)  
  <span class="hljs-keyword">if</span> (res.has_more) {  
    getMoreFiles(res.cursor, <span class="hljs-function"><span class="hljs-params">more</span> =&gt;</span> updateFiles(more.entries))  
  }  
}
</code></pre>
<p>We can improve the user experience, but adding a loading message when more files need to be loaded.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> loadingElem = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.js-loading'</span>)

<span class="hljs-keyword">const</span> init = <span class="hljs-keyword">async</span> () =&gt; {  
  <span class="hljs-keyword">const</span> res = <span class="hljs-keyword">await</span> dbx.filesListFolder({  
    <span class="hljs-attr">path</span>: <span class="hljs-string">''</span>,  
    <span class="hljs-attr">limit</span>: <span class="hljs-number">20</span>  
  })  
  updateFiles(res.entries)  
  <span class="hljs-keyword">if</span> (res.has_more) {  
    loadingElem.classList.remove(<span class="hljs-string">'hidden'</span>)  
    getMoreFiles(res.cursor, <span class="hljs-function"><span class="hljs-params">more</span> =&gt;</span> updateFiles(more.entries))  
    loadingElem.classList.add(<span class="hljs-string">'hidden'</span>)  
  } <span class="hljs-keyword">else</span> {  
    loadingElem.classList.add(<span class="hljs-string">'hidden'</span>)  
  }  
}
</code></pre>
<p>Now we can implement <code>getMoreFiles()</code> function.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> getMoreFiles = <span class="hljs-keyword">async</span> (cursor, cb) =&gt; {  
  <span class="hljs-keyword">const</span> res = <span class="hljs-keyword">await</span> dbx.filesListFolderContinue({ cursor })

<span class="hljs-comment">// we check if the callback is provided and if so - call it  </span>
  <span class="hljs-keyword">if</span> (cb) cb(res)

<span class="hljs-keyword">if</span> (res.has_more) {  
    <span class="hljs-comment">// if there are more files, call getMoreFiles recursively,  </span>
    <span class="hljs-comment">// providing the same callback.  </span>
    <span class="hljs-keyword">await</span> getMoreFiles(res.cursor, cb)  
  }  
}
</code></pre>
<h3 id="heading-change-the-file-path">Change the File Path</h3>
<p>Wow, we’ve written some really amazing code so far.</p>
<p>One thing that would be really cool is if we weren’t so restricted to just the root path all the time.</p>
<p>This is exactly we are going to learn in this cast.</p>
<p>To get us started, Christian made some changes to HTML and CSS in our app and the main change is <code>Folder Path</code> field. This is where the user could specify the folder that they would like to go to.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*gZAp61MtyVaDI0cXtRMwHg.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>We can make this work by listening to the submit event on <code>rootPathForm</code>, when the user lets us know where they want to go. We then verify their input and prevent basic errors, like using the wrong casing for a name of a folder. We should also store the value of the <code>rootPathInput</code> in our <code>state</code> to be able to reuse it in the rest of our application.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*03zOVoz5trfXiSOr2Zqitw.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-move-files">Move Files</h3>
<p>In this lesson, we’re going to implement the main function of our app — the ability to organize our files into folders, based on the date modified.</p>
<p>First, we need to add some organizational code, to make sure that our core functionality feels nice to our users before we implement <code>moveFilesToDatedFolders()</code>.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> organizeBtn = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.js-organize-btn'</span>)

organizeBtn.addEventListener(<span class="hljs-string">'click'</span>, <span class="hljs-keyword">async</span> e =&gt; {  
  <span class="hljs-keyword">const</span> originalMsg = e.target.innerHTML  
  e.target.disabled = <span class="hljs-literal">true</span>  
  e.target.innerHTML = <span class="hljs-string">'Working...'</span>  
  <span class="hljs-keyword">await</span> moveFilesToDatedFolders()  
  e.target.disabled = <span class="hljs-literal">false</span>  
  e.target.innerHTML = originalMsg  
})
</code></pre>
<p>Next, let’s implement <code>moveFilesToDatedFolders()</code> that will use Dropbox’s <code>filesMoveBatchV2()</code>.</p>
<pre><code class="lang-js"><span class="hljs-comment">// Basic API implementation.   </span>
dbx.filesMoveBatchV2({  
  <span class="hljs-attr">entries</span>: [{  
    <span class="hljs-attr">from_path</span>: <span class="hljs-string">'some_folder'</span>,  
    <span class="hljs-attr">to_path</span>: <span class="hljs-string">'some_other_folder'</span>  
  }]  
})
</code></pre>
<p>Of course, we’re not going to use hardcoded values in our app and Christian will show us how to generate <code>entries</code> array, organized by date modified value, so the folder names are going to have names based on these dates.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*WiYmVjk9fjXrwCRezKGO8g.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-show-moved-files">Show Moved Files</h3>
<p>In the previous screencast, Christian showed us how to move files into their own folders based on modified date and in this cast we learn how to refine the existing functionality.</p>
<p><code>filesMoveBatchV2()</code> returns one of two things: <code>success</code> if the call was immediately successful, and it might happen if we ask to move one or two files. However, most likely it’s going to return an object with a property <code>async_job_id</code>, and that means that your call is being executed.</p>
<p>In this case, we can use <code>filesMoveBatchCheckV2()</code> to check for completion of our job until it’s complete, or in other words, is not <code>in_progress</code>.</p>
<p>That’s where Christian helps us to rewrite the <code>moveFilesToDatedFolders()</code>using a neat <code>do while</code> loop, the key feature of which, is that it’s guaranteed to be executed at least once.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*46QxT5lsz3I1MQR4329fEA.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>There is now one more thing we need to do — after the user moves the files, we want to show them what a new state looks like, without them having to refresh the page.</p>
<p>We essentially want to reuse this piece of functionality:</p>
<pre><code class="lang-js">state.files = []  
loadingElem.classList.remove(<span class="hljs-string">'hidden'</span>)  
init()
</code></pre>
<p>And let’s extract it into a new <code>reset()</code> method.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*FA9mBlGKoqQ2jSCi_rQHwA.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>We can now see the functionality working. Hit <em>‘Organise’</em> and watch all of our files getting magically put into folders. Here’s a gif of how it works:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*mHskcCs411DZp9GVdFPj9Q.gif" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>This is the end of the course, so congratulations on completing it! You should now be familiar with how to get files and thumbnails, and how to move files using the Dropbox API. Plus, you’ll have learned several ES6 concepts.</p>
<p>Finally, I want to thank Dropbox for sponsoring and paying for this post and the course itself. It helps Scrimba keep the lights on and it enables us to create more free content for our community throughout 2019.</p>
<p>Happy coding :)</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
