cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 
Announcements
Whatā€™s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Discuss Dropbox Developer & API

cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

Dropbox upload via Python

Dropbox upload via Python

Holzauge20
Explorer | Level 4
Go to solution

The Dropbox upload via Python script file with the Raspberry Pi via the API  interface suddenly no longer works. Does anybody have the same Problem ?

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

This may be due to a recent change to our TLS configuration. Dropbox recently retired support for older versions of the TLS protocol, specifically 1.0 and 1.1. You'll need to make sure your app uses TLS 1.2. If you're using the Dropbox Python SDK, to use TLS 1.2 you'll need to update to at least v8.4.1 of that SDK (or preferably, the latest version which is currently v11.29.0).

 

Otherwise, I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. In that case, please reply with:

  • the name and version number of the platform and SDK/library you are using, if any
  • the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)
  • the full text of any error or unexpected output

View solution in original post

7 Replies 7

Greg-DB
Dropbox Staff
Go to solution

This may be due to a recent change to our TLS configuration. Dropbox recently retired support for older versions of the TLS protocol, specifically 1.0 and 1.1. You'll need to make sure your app uses TLS 1.2. If you're using the Dropbox Python SDK, to use TLS 1.2 you'll need to update to at least v8.4.1 of that SDK (or preferably, the latest version which is currently v11.29.0).

 

Otherwise, I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. In that case, please reply with:

  • the name and version number of the platform and SDK/library you are using, if any
  • the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)
  • the full text of any error or unexpected output

Holzauge20
Explorer | Level 4
Go to solution

That was the solution. you helped me a lot.

Thanks very much.

streetcodernate
Explorer | Level 4
Go to solution

This still isn't working for me. I am using version 11.30.0 and my code looks like this:

 

def upload_file_to_dropbox(_file, file_name):
    dbx = get_dropbox_client()
    try:
        dbx.files_upload(_file.read(), '/CSV_UPLOADS/' + file_name)
        print(f'file {file_name} uploaded to dropbox')
    except Exception as e:
        print(e)
        return False

what could be my issue?

 

Greg-DB
Dropbox Staff
Go to solution

@streetcodernate Can you elaborate on what you mean when you say it isn't working for you? What error or unexpected output are you getting?

streetcodernate
Explorer | Level 4
Go to solution

My bad, man! Iā€™m actually not receiving any error! The files_upload function seems to be successful as no exception is thrown, but when I check the /CSV_UPLOADS folder, the file that was supposed to be uploaded isnā€™t there! 

streetcodernate
Explorer | Level 4
Go to solution

Wow, nvm! I found the folder! It was uploading to an entirely different folder due to me changing the scope of my access token. It's all good now. Thanks for the help, Greg

Š—Š“рŠ°Š²ŠŗŠ¾
Legendary | Level 20
Go to solution

@streetcodernate wrote:

... but when I check the /CSV_UPLOADS folder, the file that was supposed to be uploaded isnā€™t there! 


Hi @streetcodernate,

Does you application have full account access or only application folder access? šŸ§ If it's the second case where are you actually looking for your CSV_UPLOADS folder? šŸ¤” In account root folder or within the application folder? šŸ˜‰

Hope this gives direction.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Š—Š“рŠ°Š²ŠŗŠ¾ Legendary | Level 20
  • User avatar
    streetcodernate Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?