cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

UploadWriteFailed(reason=WriteError('disallowed_name', None)

UploadWriteFailed(reason=WriteError('disallowed_name', None)

rekte
Explorer | Level 3

I'm trying to upload a whole folder to dropbox but only the files get uploaded. Should I create a folder programatically or can I solve the folder-uploading so simple? Thanks

 

 

import os
import dropbox
    access_token = '***********************'
    dbx = dropbox.Dropbox(access_token)
    dropbox_destination = '/live'
    local_directory = 'C:/Users/xoxo/Desktop/man'
    for root, dirs, files in os.walk(local_directory):
        for filename in files:
            local_path = root + '/' + filename
            print("local_path", local_path)
            relative_path = os.path.relpath(local_path, local_directory)
            dropbox_path = dropbox_destination + '/' + relative_path
            # upload the file
             with open(local_path, 'rb') as f:
                    dbx.files_upload(f.read(), dropbox_path)

 

error:

dropbox.exceptions.ApiError: ApiError('xxf84e5axxf86', UploadError('path', UploadWriteFailed(reason=WriteError('disallowed_name', None), upload_session_id='xxxxxxxxxxx')))
2 Replies 2

Mark
Super User II
*moves to API area*

 


:penguin::penguin: - :penguin: - :penguin: - :penguin:


Heart Did this post help you? If so please mark it for some Kudos below. 


:white_check_mark: Did this post fix your issue/answer your question? If so please press the 'Accept as Solution' button to help others find it.


:arrows_counterclockwise: Did this post not resolve your issue? If so please give us some more information so we can try and help - please remember we cannot see over your shoulder so be as descriptive as possible! 


 

Greg-DB
Dropbox Staff
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Mark Super User II
What do Dropbox user levels mean?