Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I have an error with a file upload of ~452 MB this is the exception:
the code is picked from here
('64cb960257abb6a107b327cfefbad8ab', 502, u'\n\nDropbox - 5xx \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n')Error (5xx)
Something went wrong. Don\'t worry, your files are still safe and the Dropboxers have been notified. Check out our Help Center and forums for help, or head back to home.\n
this is the code that generate the exception:
try:
backup = open(BACKUP_DIR + '/' + backups_in_folder[-1], 'rb')
file_size = os.path.getsize(BACKUP_DIR + '/' + backups_in_folder[-1])
CHUNK_SIZE = 4 * 1024 * 1024
dbx = dropbox.Dropbox(DROPBOX_UPLOAD_ACCESSKEY)
if file_size <= CHUNK_SIZE:
dbx.files_upload(backup, '/' + backups_in_folder[-1])
else:
upload_session_start_result = dbx.files_upload_session_start(backup.read(CHUNK_SIZE))
cursor = files.UploadSessionCursor(session_id=upload_session_start_result.session_id, offset=backup.tell())
commit = files.CommitInfo(path='/' + backups_in_folder[-1])
while backup.tell() < file_size:
if (file_size - backup.tell()) <= CHUNK_SIZE:
dbx.files_upload_session_finish(backup.read(CHUNK_SIZE), cursor, commit)
else:
dbx.files_upload_session_append(backup.read(CHUNK_SIZE), cursor.session_id, cursor.offset)
cursor.offset = backup.tell()
except Exception, e:
print('* ERROR:' + str(e))
Hi Sergio, is this happening on every API call, or only some of them? If it's only some of them, about what percent?
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!