cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Whether you want to work on being more organized, your productivity or you want to use AI to make your life easier, we’ve got something for you right 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

Здравко
Legendary | 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.

Greg-DB
Dropbox Staff

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?