<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Will uploading a bunch of files that are mostly already present overwrite them, or skip them? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Will-uploading-a-bunch-of-files-that-are-mostly-already-present/m-p/449038#M23363</link>
    <description>&lt;P&gt;Exactly what would happen if you use the&amp;nbsp;Dropbox API upload functionality to upload files to paths that already exist will depend on the particular parameters you use when uploading. You can find information on the different parameters and the behaviors they will yield in the documentation, such as for the&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload" target="_self"&gt;/2/files/upload endpoint&lt;/A&gt;, which is&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_upload" target="_self"&gt;files_upload&lt;/A&gt; in &lt;A href="https://github.com/dropbox/dropbox-sdk-python" target="_self"&gt;the official&amp;nbsp;Dropbox API v2 Python SDK&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default though, that is, if you don't specify any non-default parameter values, uploading a file to a path that already contains a file with the exact same contents as the upload will essentially be a "no-op".&amp;nbsp;The call will be returned successful, but nothing will be changed in the&amp;nbsp;Dropbox folder.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that in any case though, the&amp;nbsp;Dropbox API servers have to&amp;nbsp;receive the entire upload before they can check if the contents are identical, so doing that every time will consume extra bandwidth. To avoid that, you can instead use the API to check if the file exists ahead of time, and even check the contents without uploading or downloading them first. For example, you can use the&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata" target="_self"&gt;/2/files/get_metadata endpoint&lt;/A&gt;,&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_get_metadata" target="_self"&gt;files_get_metadata&lt;/A&gt; in the&amp;nbsp;Dropbox Python SDK, to get the metadata for the file, and compute and compare &lt;A href="https://www.dropbox.com/developers/reference/content-hash" target="_self"&gt;the content hash&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Aug 2020 14:26:58 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2020-08-28T14:26:58Z</dc:date>
    <item>
      <title>Will uploading a bunch of files that are mostly already present overwrite them, or skip them?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Will-uploading-a-bunch-of-files-that-are-mostly-already-present/m-p/448862#M23359</link>
      <description>&lt;P&gt;This is my case:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a discord bot that saves a bunch of mp3s that it downloads via YoutubeDL from user input. Because the hoster resets daily, these files would only be temporary on the hoster. To solve this i am using the Python Library for the Dropbox API.&lt;/P&gt;
&lt;P&gt;Every time the bot starts, i tell it to download all the files in a specified Dropbox Folder, and heres where my problem lies:&lt;/P&gt;
&lt;P&gt;Because i the restarts of the hosters arent always at a set time, i want the bot to upload (aka backup) the files as soon as a new file is added. For simplicity, i would just tell it to upload all the files in the folder, but before i do this i want to make sure - will this result in the bot uploading EVERY FILE and overwriting the old, identical ones, or will the API see that a file is already present, and skip it - ideally with a catchable error? If the first is the case i will have to add code to compare the Dropbox files to the local ones, but if its the later i can save my time and just throw all the files at it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tested it and the "modified" timestamp didnt change for the identical files, but the script took kinda long so i wanna be sure&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 09:19:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Will-uploading-a-bunch-of-files-that-are-mostly-already-present/m-p/448862#M23359</guid>
      <dc:creator>FlyingThunder</dc:creator>
      <dc:date>2020-08-28T09:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Will uploading a bunch of files that are mostly already present overwrite them, or skip them?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Will-uploading-a-bunch-of-files-that-are-mostly-already-present/m-p/449038#M23363</link>
      <description>&lt;P&gt;Exactly what would happen if you use the&amp;nbsp;Dropbox API upload functionality to upload files to paths that already exist will depend on the particular parameters you use when uploading. You can find information on the different parameters and the behaviors they will yield in the documentation, such as for the&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload" target="_self"&gt;/2/files/upload endpoint&lt;/A&gt;, which is&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_upload" target="_self"&gt;files_upload&lt;/A&gt; in &lt;A href="https://github.com/dropbox/dropbox-sdk-python" target="_self"&gt;the official&amp;nbsp;Dropbox API v2 Python SDK&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default though, that is, if you don't specify any non-default parameter values, uploading a file to a path that already contains a file with the exact same contents as the upload will essentially be a "no-op".&amp;nbsp;The call will be returned successful, but nothing will be changed in the&amp;nbsp;Dropbox folder.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that in any case though, the&amp;nbsp;Dropbox API servers have to&amp;nbsp;receive the entire upload before they can check if the contents are identical, so doing that every time will consume extra bandwidth. To avoid that, you can instead use the API to check if the file exists ahead of time, and even check the contents without uploading or downloading them first. For example, you can use the&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata" target="_self"&gt;/2/files/get_metadata endpoint&lt;/A&gt;,&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_get_metadata" target="_self"&gt;files_get_metadata&lt;/A&gt; in the&amp;nbsp;Dropbox Python SDK, to get the metadata for the file, and compute and compare &lt;A href="https://www.dropbox.com/developers/reference/content-hash" target="_self"&gt;the content hash&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 14:26:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Will-uploading-a-bunch-of-files-that-are-mostly-already-present/m-p/449038#M23363</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-08-28T14:26:58Z</dc:date>
    </item>
  </channel>
</rss>

