I use the Dropbox API to upload files to a piece. But the following code gets stuck in uploader.upload_chunked (). What could be the reason?
Also, is there a way to find out what is going on in the background, for example, loading these many pieces, still loading, time taken to get the downloaded fragments and other information? Is it possible to use threads to load these pieces, assuming the API takes steps to assemble the blocks in the correct order, or should we take care of an ordered assembly?
import dropbox size = 941 access_token = 'xxx' client = dropbox.client.DropboxClient(access_token) to_upload_file = open('dummy.txt','r') uploader = client.get_chunked_uploader(to_upload_file,size) print 'uploading ', size while uploader.offset < size : try: upload = uploader.upload_chunked(chunk_size=100) print '100 bytes of chunk sent.' except dropbox.rest.ErrorResponse,e: print 'something went wrong' uploader.finish('/dummy.txt')
Edit :
size = 941 File size to download
upload=uploader.upload_chunked(chunk_size=100) > chunk_size changed from default to 100 bytes
print'100 bytes of chunk sent' β print request included
source share