Forum Discussion

hossamalamsto5's avatar
hossamalamsto5
New member | Level 2
7 years ago

How to know upload progress to use it in QProgressBar (python)

this is my code please edit it to get the value of upload progress.

import pathlib
import dropbox
import re

# the source file
folder = pathlib.Path("C:\\Users\\Hossam\\Desktop\\test\\backup")    # located in this folder
filename = "20180911-183844.sql"         # file name
filepath = folder / filename  # path object, defining the file

# target location in Dropbox
target = "/home/Apps/Sinapi"              # the target folder
targetfile = target + filename   # the target path and file name

# Create a dropbox object using an API v2 key
d = dropbox.Dropbox('my_access')

# open the file and upload it
with filepath.open("rb") as f:
   # upload gives you metadata about the file
   # we want to overwite any previous version of the file
   meta = d.files_upload(f.read(), targetfile, mode=dropbox.files.WriteMode("overwrite"))

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The Dropbox Python SDK doesn't offer a way to track progress of uploads, but I'll pass this along as a feature request. 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 11 hours ago
352 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!