Hello everyone,
I know that there are other issues related to this but I did not find anything that really helped me.
I'm trying to upload images (.png) from my PC to dropbox via an application that I already created.
I'm doing this using a python script I wrote. The part that concerns the dropbox upload is the following:
def upload_to_dropbox(file_path, dropbox_token, dropbox_folder):
dbx = dropbox.Dropbox(dropbox_token)
with open(file_path, 'rb') as f:
filename = os.path.basename(file_path)
dropbox_path = dropbox_folder+filename
dbx.files_upload(f.read(), dropbox_path)
shared_link_metadata = dbx.sharing_create_shared_link(dropbox_path)
return shared_link_metadata.url
In doing this I'm using an access token that I generate in the Console App. This token begins with "sl" and I know that expires in few hours.
Could you please provide me support on how to get a long-live token, or how to refresh automatically the token I'm using?
Thank you in advance 🙂
D.