Reputation: 115
I am currently doing a motion detection program. I have already managed to capture images when motion is detected. I want the photos to be uploaded to Dropbox when captured. It works fine for the first few images but stops working after awhile. It displays the following error
ApiError: ApiError('', UploadError(u'path', UploadWriteFailed(reason=WriteError(u'conflict', WriteConflictError(u'file', None)), upload_session_id=u'')))
This is my code
def TakePicUpload(avg):
Upvotes: 3
Views: 3388
Reputation: 16940
You're getting a file
WriteConflictError
:
That's documented as:
There’s a file in the way.
So, that just means there's already at the path (savetolocation
in your case) where you're trying to upload.
You can either remove that file if you don't want it, or specify a different write mode when calling files_upload
:
More specifically you can add mode=dropbox.files.WriteMode.overwrite
as a parameter to files_upload method.
Upvotes: 7