cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We love to hear how every person gets the most from Dropbox, and it seems everyone has a slightly different use for it - tell us yours here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

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

Error when uploading to folder - Python client

Error when uploading to folder - Python client

vherasme
Explorer | Level 4

Hello. I am trying to upload a file using this Python code:

with open("{} - my-file-name.xlsx".format(
        datetime.now().strftime('%Y%m%d')), "rb") as f:
    dbx.files_upload(
        f.read(),
        "/path/to/folder{} - my-file-name.xlsx".format(
            datetime.now().strftime('%Y%m%d')))

 And I am getting this error:

Upload to Dropbox error: ApiError('*******************', UploadError('path', UploadWriteFailed(reason=WriteError('conflict', WriteConflictError('file', None)), upload_session_id='*******************')))

Can anyone help pls?

2 Replies 2

Re: Error when uploading to folder - Python client

Здравко
Super Collaborator | Level 20

Hi @vherasme,

Seems the file already exists. If I have to bet, You probably make erroneous upload instead update. :wink:

Hope this gives some direction.

Re: Error when uploading to folder - Python client

Greg-DB
Dropboxer

That's correct, that 'path/conflict/file' indicates the upload failed because there's already a file at the specified path. You can find this WriteConflictError error in the documentation here.

You can control the conflict behavior via the `mode` and `autorename` parameters for the `files_upload` method. The documentation there has more information about the different options and what they do.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    Здравко Super Collaborator | Level 20
What do Dropbox user levels mean?
Need more support?