<?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 v2 dropbox.files_upload_session_finish offset error in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Api-v2-dropbox-files-upload-session-finish-offset-error/m-p/288766#M123</link>
    <description>&lt;P&gt;Is there any way to use ```&amp;lt;pre&amp;gt;``` tag on my code so the code could be more understanding&lt;/P&gt;</description>
    <pubDate>Fri, 03 Aug 2018 13:04:59 GMT</pubDate>
    <dc:creator>Yashik</dc:creator>
    <dc:date>2018-08-03T13:04:59Z</dc:date>
    <item>
      <title>Api v2 dropbox.files_upload_session_finish offset error</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Api-v2-dropbox-files-upload-session-finish-offset-error/m-p/288738#M122</link>
      <description>problem is the offset of files_upload_session_finish , I am using the content length for the offset but it is giving error&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;import dropbox,requests,sys&lt;BR /&gt;def down(url):&lt;BR /&gt;&lt;BR /&gt;dbx=dropbox.Dropbox(AccessToken)&lt;BR /&gt;&lt;BR /&gt;size=45*1024&lt;BR /&gt;a=0&lt;BR /&gt;i=0&lt;BR /&gt;p=0&lt;BR /&gt;params = {'':'', 'render':'download'}&lt;BR /&gt;r=requests.get(url,params=params,stream=True)&lt;BR /&gt;clen=r.headers['Content-length']&lt;BR /&gt;&lt;BR /&gt;for chunk in r.iter_content(chunk_size=size):&lt;BR /&gt;&lt;BR /&gt;if chunk:&lt;BR /&gt;i+=1&lt;BR /&gt;a+=len(chunk)&lt;BR /&gt;c=a/(1024)&lt;BR /&gt;print('\n'+str(c)+' of '+str(clen))&lt;BR /&gt;if i==1:&lt;BR /&gt;strtid = dbx.files_upload_session_start(chunk)&lt;BR /&gt;cursor = dropbox.files.UploadSessionCursor(session_id=strtid.session_id,offset=len(chunk))&lt;BR /&gt;commit = dropbox.files.CommitInfo(path='/sourttt',mode=dropbox.files.WriteMode('add'))&lt;BR /&gt;if ((int(clen)-p))&amp;lt;=size:&lt;BR /&gt;cur=dropbox.files.UploadSessionCursor(session_id=strtid.session_id,offset=int(a))&lt;BR /&gt;dbx.files_upload_session_finish(chunk,cur,commit)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;else:&lt;BR /&gt;dbx.files_upload_session_append(chunk,cursor.session_id,a)&lt;BR /&gt;p=a&lt;BR /&gt;&lt;BR /&gt;url='&lt;A href="https://speedtest.ftp.otenet.gr/files/test100k.db" target="_blank"&gt;https://speedtest.ftp.otenet.gr/files/test100k.db&lt;/A&gt;'&lt;BR /&gt;down(url)&lt;BR /&gt;&lt;BR /&gt;Error:&lt;BR /&gt;&lt;BR /&gt;dropbox.exceptions.ApiError: ('281cb346aa41adc8436f415fc4d0de0a', UploadSessionFinishError('lookup_failed', UploadSessionLookupError('incorrect_offset', UploadSessionOffsetError(correct_offset=138240))))&lt;BR /&gt;&lt;BR /&gt;The content length is 100Kb(102400) but the error showing me the correct offset is 138240 and the difference between those are 35Kb . What should I do for offset value in files_upload_session_finish&lt;BR /&gt;?</description>
      <pubDate>Wed, 29 May 2019 09:05:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Api-v2-dropbox-files-upload-session-finish-offset-error/m-p/288738#M122</guid>
      <dc:creator>Yashik</dc:creator>
      <dc:date>2019-05-29T09:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Api v2 dropbox.files_upload_session_finish offset error</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Api-v2-dropbox-files-upload-session-finish-offset-error/m-p/288766#M123</link>
      <description>&lt;P&gt;Is there any way to use ```&amp;lt;pre&amp;gt;``` tag on my code so the code could be more understanding&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 13:04:59 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Api-v2-dropbox-files-upload-session-finish-offset-error/m-p/288766#M123</guid>
      <dc:creator>Yashik</dc:creator>
      <dc:date>2018-08-03T13:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Api v2 dropbox.files_upload_session_finish offset error</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Api-v2-dropbox-files-upload-session-finish-offset-error/m-p/288803#M125</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/748828"&gt;@Yashik&lt;/a&gt;&amp;nbsp;It looks like you had some trouble with the forum's spam filter and so made this extra thread. I'll close this one and resume the conversation on your original thread so we can keep that in one place:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropboxforum.com/t5/General-Discussion/Dropbox-v2-upload-cursor-offset-confusion/m-p/288017" target="_self"&gt;https://www.dropboxforum.com/t5/General-Discussion/Dropbox-v2-upload-cursor-offset-confusion/m-p/288017&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yes, the forum's "Rich Text" editor has a code button you can use to get code formatting. The button has a label like "&amp;lt;/&amp;gt;".&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 15:36:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Api-v2-dropbox-files-upload-session-finish-offset-error/m-p/288803#M125</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-03T15:36:09Z</dc:date>
    </item>
  </channel>
</rss>

