cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We want to hear from you. What projects do you use Dropbox for?
Close

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: 
Highlighted

Error when uploading to folder - Python client

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
Highlighted

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.

Hope this gives some direction.

Highlighted

Re: Error when uploading to folder - Python client

Dropboxer
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.

Polls
Do you know how to organize your files and folders?
We have created a guide on folder best practice, so you can get organized now check it out here.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?