<?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: API raises exception when uploading big files in session in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235742#M12955</link>
    <description>&lt;P&gt;just '/'(home folder), when i try to upload a smaller file to the same destination it works.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Aug 2017 04:29:55 GMT</pubDate>
    <dc:creator>testuser1</dc:creator>
    <dc:date>2017-08-07T04:29:55Z</dc:date>
    <item>
      <title>API raises exception when uploading big files in session</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235710#M12951</link>
      <description>&lt;P&gt;Hi, I have been trying for a few days to upload a big file into my Dropbox account using the python&amp;nbsp;API,&lt;/P&gt;&lt;P&gt;i have tried using the following code:&lt;/P&gt;&lt;PRE&gt;f = open(file_path)
file_size = os.path.getsize(file_path)

CHUNK_SIZE = 4 * 1024 * 1024

if file_size &amp;lt;= CHUNK_SIZE:

    print dbx.files_upload(f.read(), dest_path)

else:

    upload_session_start_result = dbx.files_upload_session_start(f.read(CHUNK_SIZE))
    cursor = dropbox.files.UploadSessionCursor(session_id=upload_session_start_result.session_id,
                                               offset=f.tell())
    commit = dropbox.files.CommitInfo(path=dest_path)

    while f.tell() &amp;lt; file_size:
        if ((file_size - f.tell()) &amp;lt;= CHUNK_SIZE):
            print dbx.files_upload_session_finish(f.read(CHUNK_SIZE),
                                            cursor,
                                            commit)
        else:
            dbx.files_upload_session_append(f.read(CHUNK_SIZE),
                                            cursor.session_id,
                                            cursor.offset)
            cursor.offset = f.tell()

f.close()&lt;/PRE&gt;&lt;P&gt;but everytime i get the same exception when reaching&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dbx.files_upload_session_finish(f.read(CHUNK_SIZE),
                                            cursor,
                                            commit)&lt;BR /&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;the exception is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dropbox.exceptions.ApiError: ApiError('fa8b9a1a5c61684f4e6f58f2c695c248', UploadSessionFinishError('path', WriteError('malformed_path', None)))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been stuck on this for days, anyone has any suggestions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I have tried already switching the following function to the v2 version, but it didn't&amp;nbsp;helpped&lt;/P&gt;&lt;PRE&gt;files_upload_session_append&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:20:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235710#M12951</guid>
      <dc:creator>testuser1</dc:creator>
      <dc:date>2019-05-29T09:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: API raises exception when uploading big files in session</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235714#M12952</link>
      <description>The error is "malformed_path." What's the value of dest_path?</description>
      <pubDate>Sun, 06 Aug 2017 18:01:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235714#M12952</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2017-08-06T18:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: API raises exception when uploading big files in session</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235742#M12955</link>
      <description>&lt;P&gt;just '/'(home folder), when i try to upload a smaller file to the same destination it works.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 04:29:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235742#M12955</guid>
      <dc:creator>testuser1</dc:creator>
      <dc:date>2017-08-07T04:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: API raises exception when uploading big files in session</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235748#M12956</link>
      <description>&lt;DIV class="lia-quilt-column lia-quilt-column-18 lia-quilt-column-left lia-quilt-column-main-content"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;&lt;DIV class="lia-component-reply-list"&gt;&lt;DIV class="linear-message-list message-list"&gt;&lt;DIV class="lia-linear-display-message-view"&gt;&lt;DIV class=""&gt;&lt;DIV class="lia-panel-message message-uid-235742"&gt;&lt;DIV class="lia-message-view-wrapper lia-component-forums-widget-message-view-two"&gt;&lt;DIV class="MessageView lia-message-view-forum-message lia-message-view-display lia-row-standard-read lia-thread-reply"&gt;&lt;DIV class="lia-quilt lia-quilt-forum-message lia-quilt-layout-forum-message-two-column"&gt;&lt;DIV class="lia-quilt-row lia-quilt-row-main"&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-24 lia-quilt-column-single lia-quilt-column-main-left"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-single"&gt;&lt;DIV class="lia-message-body lia-component-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;just '/'(home folder), when i try to upload a smaller file to the same destination it works.&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-quilt-row lia-quilt-row-footer"&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-12 lia-quilt-column-left lia-quilt-column-footer-left"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;&lt;DIV class="KudosButton lia-button-image-kudos-wrapper lia-component-kudos-widget-button-version-3 lia-component-kudos-widget-button-horizontal lia-component-kudos-widget-button lia-component-kudos-action"&gt;&lt;DIV class="lia-button-image-kudos lia-button-image-kudos-horizontal lia-button-image-kudos-disabled lia-button-image-kudos-not-kudoed lia-button"&gt;&lt;DIV class="lia-button-image-kudos-count"&gt;&lt;SPAN class="lia-link-navigation kudos-count-link lia-link-disabled"&gt;&lt;SPAN class="MessageKudosCount lia-component-kudos-widget-message-kudos-count"&gt;0&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-button-image-kudos-label lia-component-kudos-widget-kudos-count-label"&gt;Kudos&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-button-image-kudos-give"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-12 lia-quilt-column-right lia-quilt-column-footer-right"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;&lt;SPAN class="lia-button-wrapper lia-button-wrapper-secondary"&gt;&lt;A href="https://www.dropboxforum.com/t5/forums/replypage/board-id/101000014/message-id/12955" target="_blank" rel="nofollow"&gt;Quick Reply&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-button-wrapper lia-button-wrapper-secondary lia-component-quick-reply-button"&gt;&lt;A href="https://www.dropboxforum.com/t5/forums/replypage/board-id/101000014/message-id/12955" target="_blank" rel="nofollow"&gt;Reply&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-button-wrapper lia-button-wrapper-secondary lia-component-accepted-solutions-actions-mark-message-as-accepted-solution-secondary-button lia-component-accepted-solutions-button"&gt;&lt;A href="https://www.dropboxforum.com/t5/forums/v4/forumtopicpage.markmessageasacceptedsolutionsecondarybutton/message-uid/235742?t:ac=board-id/101000014/message-id/12952&amp;amp;t:cp=solutions/contributions/acceptedsolutionsactions" target="_blank" rel="nofollow"&gt;Accept as Solution&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-quilt-row lia-quilt-row-mod-controls"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-06 lia-quilt-column-right lia-quilt-column-side-content"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;&lt;DIV class="lia-component-custom-follow-thread"&gt;&lt;DIV class="lia-decoration-border"&gt;&lt;DIV class="lia-decoration-border-top"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-decoration-border-content"&gt;&lt;DIV class="lia-button-group custom-follow-thread-content-wrapper"&gt;&lt;SPAN class="lia-button-wrapper lia-button-wrapper-primary custom-follow-thread-btn"&gt;&lt;A href="https://www.dropboxforum.com/t5/API-support/API-raises-exception-when-uploading-big-files-in-session/m-p/235714#" target="_blank"&gt;Follow&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-decoration-border-bottom"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-panel lia-panel-standard Chrome lia-panel-sidebar-support"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Aug 2017 06:54:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235748#M12956</guid>
      <dc:creator>testuser1</dc:creator>
      <dc:date>2017-08-07T06:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: API raises exception when uploading big files in session</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235759#M12958</link>
      <description>&lt;P&gt;The root should be "", not "/".&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 10:17:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235759#M12958</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2017-08-07T10:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: API raises exception when uploading big files in session</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235761#M12959</link>
      <description>&lt;P&gt;whenever i try to use "" as the root dir I get:&lt;/P&gt;&lt;PRE&gt;dropbox.stone_validators.ValidationError: '' did not match pattern '(/(.|[\r\n])*)|(ns:[0-9]+(/.*)?)'&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Aug 2017 10:33:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235761#M12959</guid>
      <dc:creator>testuser1</dc:creator>
      <dc:date>2017-08-07T10:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: API raises exception when uploading big files in session</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235798#M12960</link>
      <description>Note that when uploading a file, the path you supply should be the entire desired path for the uploaded file, including the file name. I.e., you shouldn't just specify the root path. &lt;BR /&gt;&lt;BR /&gt;For example, to upload a file named "myfile.txt" to the root, your dest_path should be "/myfile.txt". Or, to upload it into a "Documents" folder, the path would be "/Documents/myfile.txt".&lt;BR /&gt;&lt;BR /&gt;(Steve is correct that when identify the root itself though, you would just use "", but that doesn't apply here since this particular call needs the full path for the file.)</description>
      <pubDate>Mon, 07 Aug 2017 14:16:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-raises-exception-when-uploading-big-files-in-session/m-p/235798#M12960</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-08-07T14:16:56Z</dc:date>
    </item>
  </channel>
</rss>

