<?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 Upload a directory including all its files and sub-directories in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-a-directory-including-all-its-files-and-sub-directories/m-p/48818#M1523</link>
    <description>&lt;P&gt;I’m trying to upload a directory to Dropbox along with all its contents&lt;BR /&gt;
including any sub-directories and its contents using the Python API.  &lt;/P&gt;

&lt;P&gt;I can upload files OK and even create new Dropbox folders. I wonder if&lt;BR /&gt;
anyone has a solution for this. Any help or code examples would be greatly&lt;BR /&gt;
appreciated. Below the error message you can see the code.  &lt;/P&gt;

&lt;P&gt;The error message is as follows.  &lt;/P&gt;

&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;
&amp;nbsp; File "dir_2_dropbox.py", line 27, in &amp;lt;module&amp;gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; response = client.put_file(dropbox_path, f)&lt;BR /&gt;
&amp;nbsp; File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dropbox-2.2.0-py2.7.egg/dropbox/client.py", line 377, in put_file&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.rest_client.PUT(url, file_obj, headers)&lt;BR /&gt;
&amp;nbsp; File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dropbox-2.2.0-py2.7.egg/dropbox/rest.py", line 321, in PUT&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return cls.IMPL.PUT(*n, **kw)&lt;BR /&gt;
&amp;nbsp; File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dropbox-2.2.0-py2.7.egg/dropbox/rest.py", line 258, in PUT&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.request("PUT", url, body=body, headers=headers, raw_response=raw_response)&lt;BR /&gt;
&amp;nbsp; File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dropbox-2.2.0-py2.7.egg/dropbox/rest.py", line 227, in request&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; raise ErrorResponse(r, r.read())  &lt;/P&gt;

&lt;P&gt;Python code.&lt;/P&gt;

&lt;P&gt;local_dir = ('/users/ninekay/desktop/scripts')  &lt;/P&gt;

&lt;P&gt;for root, dirs, files in os.walk(local_dir):  &lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in files:  &lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; local_path = os.path.join(root, filename)  &lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; relative_path = os.path.relpath(local_path, local_dir)&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dropbox_path = os.path.join(‘/mobistudios’, relative_path)  &lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with open(local_path, 'rb') as f:&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; client.put_file(dropbox_path, f)&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:40:34 GMT</pubDate>
    <dc:creator>Mobistudios A.</dc:creator>
    <dc:date>2019-05-29T09:40:34Z</dc:date>
    <item>
      <title>Upload a directory including all its files and sub-directories</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-a-directory-including-all-its-files-and-sub-directories/m-p/48818#M1523</link>
      <description>&lt;P&gt;I’m trying to upload a directory to Dropbox along with all its contents&lt;BR /&gt;
including any sub-directories and its contents using the Python API.  &lt;/P&gt;

&lt;P&gt;I can upload files OK and even create new Dropbox folders. I wonder if&lt;BR /&gt;
anyone has a solution for this. Any help or code examples would be greatly&lt;BR /&gt;
appreciated. Below the error message you can see the code.  &lt;/P&gt;

&lt;P&gt;The error message is as follows.  &lt;/P&gt;

&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;
&amp;nbsp; File "dir_2_dropbox.py", line 27, in &amp;lt;module&amp;gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; response = client.put_file(dropbox_path, f)&lt;BR /&gt;
&amp;nbsp; File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dropbox-2.2.0-py2.7.egg/dropbox/client.py", line 377, in put_file&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.rest_client.PUT(url, file_obj, headers)&lt;BR /&gt;
&amp;nbsp; File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dropbox-2.2.0-py2.7.egg/dropbox/rest.py", line 321, in PUT&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return cls.IMPL.PUT(*n, **kw)&lt;BR /&gt;
&amp;nbsp; File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dropbox-2.2.0-py2.7.egg/dropbox/rest.py", line 258, in PUT&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.request("PUT", url, body=body, headers=headers, raw_response=raw_response)&lt;BR /&gt;
&amp;nbsp; File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dropbox-2.2.0-py2.7.egg/dropbox/rest.py", line 227, in request&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; raise ErrorResponse(r, r.read())  &lt;/P&gt;

&lt;P&gt;Python code.&lt;/P&gt;

&lt;P&gt;local_dir = ('/users/ninekay/desktop/scripts')  &lt;/P&gt;

&lt;P&gt;for root, dirs, files in os.walk(local_dir):  &lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in files:  &lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; local_path = os.path.join(root, filename)  &lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; relative_path = os.path.relpath(local_path, local_dir)&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dropbox_path = os.path.join(‘/mobistudios’, relative_path)  &lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with open(local_path, 'rb') as f:&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; client.put_file(dropbox_path, f)&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:40:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-a-directory-including-all-its-files-and-sub-directories/m-p/48818#M1523</guid>
      <dc:creator>Mobistudios A.</dc:creator>
      <dc:date>2019-05-29T09:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a directory including all its files and sub-directories</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-a-directory-including-all-its-files-and-sub-directories/m-p/48819#M1524</link>
      <description>&lt;P&gt;[Cross linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/32034819/error-when-uploading-a-directory-to-dropbox-including-all-files-and-sub-director" rel="nofollow noreferrer"&gt;https://stackoverflow.com/questions/32034819/error-when-uploading-a-directory-to-dropbox-including-all-files-and-sub-director&lt;/A&gt; ]&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 00:10:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-a-directory-including-all-its-files-and-sub-directories/m-p/48819#M1524</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-08-17T00:10:13Z</dc:date>
    </item>
  </channel>
</rss>

