Update existing files via Python SDK
AnsweredHi,
I need to update a file using the Python SDK.
I know if a file exists and can get it's ID but can't find which Python SDK method to use.
I've seen references to client.folder(box_folder_id).upload(WORK_PATH+item_file) and
chunked_uploader = client.file(item.id).get_chunked_uploader(item_file)
uploaded_file = chunked_uploader.start()
But both throw this error:
boxsdk.exception.BoxAPIException: Message: Item with the same name already exists
Status: 409
Code: item_name_in_use
Any suggestions?
-
Hi
You can use the 'update_contents' from the python SDK
https://github.com/box/box-python-sdk/blob/main/docs/usage/files.md#upload-a-new-version-of-a-file
Rgds,
Peter Christensen, Platform Solutions Engineer, Box
Post is closed for comments.
Comments
2 comments