<?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 measuring the amount of file uploaded in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/272349#M16170</link>
    <description>&lt;P&gt;Say I'd got a 300MB file, the example docs state to read the file to be uploaded in one gulp since an append method is not available(&lt;A href="https://www.dropboxforum.com/t5/API-support/How-to-append-to-existing-file/m-p/271603/highlight/true#M16083" target="_blank"&gt;https://www.dropboxforum.com/t5/API-support/How-to-append-to-existing-file/m-p/271603/highlight/true#M16083&lt;/A&gt;) , via the api(or any method possible for which the file can be uploaded in chunks) is there a api call that tells us the amount of file uploaded so that we can measure the status to construct something like a progressbar for our applications?&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:13:58 GMT</pubDate>
    <dc:creator>beezaen</dc:creator>
    <dc:date>2019-05-29T09:13:58Z</dc:date>
    <item>
      <title>measuring the amount of file uploaded</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/272349#M16170</link>
      <description>&lt;P&gt;Say I'd got a 300MB file, the example docs state to read the file to be uploaded in one gulp since an append method is not available(&lt;A href="https://www.dropboxforum.com/t5/API-support/How-to-append-to-existing-file/m-p/271603/highlight/true#M16083" target="_blank"&gt;https://www.dropboxforum.com/t5/API-support/How-to-append-to-existing-file/m-p/271603/highlight/true#M16083&lt;/A&gt;) , via the api(or any method possible for which the file can be uploaded in chunks) is there a api call that tells us the amount of file uploaded so that we can measure the status to construct something like a progressbar for our applications?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:13:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/272349#M16170</guid>
      <dc:creator>beezaen</dc:creator>
      <dc:date>2019-05-29T09:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: measuring the amount of file uploaded</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/272385#M16172</link>
      <description>&lt;P&gt;There isn't a way to check the progress of an in-process upload remotely via the API. Depending on what, if any, SDK or library you're using though, there may be a local progress callback available though. (For example, &lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c#upload-style-request" target="_blank"&gt;here's a sample of using that in the Objective-C SDK&lt;/A&gt;.) Check the documentation for whatever SDK/library, if any, you're using for more information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that for files larger than 150 MB though, you should be using "upload sessions", which do have you upload files in pieces:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-start" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-start&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-append_v2" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-append_v2&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-finish" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-finish&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that way, you can track (again, from the API client side) how much you've uploaded, in between calls.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 14:14:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/272385#M16172</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-04-13T14:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: measuring the amount of file uploaded</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/272478#M16179</link>
      <description>&lt;P&gt;Yes, I actually found out about the upload session recently, but it's giving me errors. For example, I'm using this core logic for upload sessions, but I'm getting a connection timeout error or something like API error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;test_files = ['testfile.iso']&lt;BR /&gt;file_path = os.path.join(os.path.dirname(os.path.abspath('__file__')),test_files[0])
file_size =os.path.getsize(file_path)
chunk_size = 4*1024*1024 # 4mb chunks
dest_path = '/upload_filetest.iso'


dbx = dropbox.Dropbox("{}".format(dropbox_id))#dropbox_id is my api key
f = open(file_path, 'rb')

if file_size &amp;lt;= chunk_size:
    dbx.files_upload(f.read(), dest_path)
    f.close()
    print("file has been uploaded")
else:
    upload_session_info = dbx.files_upload_session_start(f.read(chunk_size), close=False)
    print("Chunk uploaded from start: ", f.tell()/(1024*1024))
    #session_id = upload_session_info.session_id
    print("The session_id is: ", upload_session_info.session_id)
    cursor = dropbox.files.UploadSessionCursor(session_id=upload_session_info.session_id,  
                offset=f.tell())                                     
    
    commit = dropbox.files.CommitInfo(dest_path)

    while f.tell() &amp;lt; file_size:
        if (file_size - f.tell()) &amp;lt;= chunk_size:
            dbx.files_upload_session_finish(f.read(chunk_size), cursor, commit)
            print("chunk uploaded in finish: ", f.tell()/(1024*1024))
            time.sleep(1)
        
        else:
            dbx.files_upload_session_append_v2(f.read(chunk_size), cursor)
            cursor = dropbox.files.UploadSessionCursor(session_id=upload_session_info.session_id,offset=f.tell())

            print("Chunk uploaded in append: ", f.tell()/(1024*1024))
            time.sleep(1)



f.close()  &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Apr 2018 14:21:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/272478#M16179</guid>
      <dc:creator>beezaen</dc:creator>
      <dc:date>2018-04-14T14:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: measuring the amount of file uploaded</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/272646#M16190</link>
      <description>Can you share the full error output you're getting?</description>
      <pubDate>Mon, 16 Apr 2018 15:34:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/272646#M16190</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-04-16T15:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: measuring the amount of file uploaded</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/273014#M16226</link>
      <description>&lt;P&gt;I had been researchin on this, and found that, I should replace&lt;/P&gt;
&lt;PRE&gt;cursor = dropbox.files.UploadSessionCursor(session_id=upload_session_info.session_id,offset=f.tell())  &lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;cursor = f.tell()&lt;/PRE&gt;
&lt;P&gt;Don't know if it was the issue, but, the error is gone. I tried cutting off my network and it gave me a similar issue, so, it could've related to network connectivity as well.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 16:39:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/measuring-the-amount-of-file-uploaded/m-p/273014#M16226</guid>
      <dc:creator>beezaen</dc:creator>
      <dc:date>2018-04-18T16:39:36Z</dc:date>
    </item>
  </channel>
</rss>

