Estoy usando el siguiente código en Python para subir un archivo de más de 150MB a través de la API V2, pero en determinado punto obtengo el siguiente error: ApiError('22721c262fe77ea6ac8a66df83e76b3a', UploadSessionFinishError(u'path', WriteError(u'conflict', WriteConflictError(u'file', None))))
f = open(file_path)
file_size = os.path.getsize(file_path)
CHUNK_SIZE = 4 * 1024 * 1024
if file_size <= CHUNK_SIZE:
print dbx.files_upload(f, dest_path)
else:
upload_session_start_result = dbx.files_upload_session_start(f.read(CHUNK_SIZE))
cursor = dropbox.files.UploadSessionCursor(session_id=upload_session_start_result.session_id,
offset=f.tell())
commit = dropbox.files.CommitInfo(path=dest_path)
while f.tell() < file_size:
if ((file_size - f.tell()) <= CHUNK_SIZE):
print dbx.files_upload_session_finish(f.read(CHUNK_SIZE),
cursor,
commit)
else:
dbx.files_upload_session_append(f.read(CHUNK_SIZE),
cursor.session_id,
cursor.offset)
cursor.offset = f.tell()
Necesitaria ayuda ya que es un script para generar backups. El archivo pesa algo más de 1GB.