import dropbox
client = dropbox.client.DropboxClient('<token>')
f = open('/ssd-scratch/abhishekb/try/1.mat', 'rb')
response = client.put_file('/data/1.mat', f)
Desidero caricare un file di grandi dimensioni su Dropbox. Come posso controllare i progressi? [Docs]Barra di avanzamento durante il caricamento di un file su dropbox
MODIFICA: L'uploader offeset è lo stesso in qualche modo. Che cosa sto facendo di sbagliato
import os,pdb,dropbox
size=1194304
client = dropbox.client.DropboxClient(token)
path='D:/bci_code/datasets/1.mat'
tot_size = os.path.getsize(path)
bigFile = open(path, 'rb')
uploader = client.get_chunked_uploader(bigFile, size)
print "uploading: ", tot_size
while uploader.offset < tot_size:
try:
upload = uploader.upload_chunked()
print uploader.offset
except rest.ErrorResponse, e:
print("something went wrong")
EDIT 2:
size=1194304
tot_size = os.path.getsize(path)
bigFile = open(path, 'rb')
uploader = client.get_chunked_uploader(bigFile, tot_size)
print "uploading: ", tot_size
while uploader.offset < tot_size:
try:
upload = uploader.upload_chunked(chunk_size=size)
print uploader.offset
except rest.ErrorResponse, e:
print("something went wrong")
@ Kevin uscita: 'upload: 1700302131' –
Qual è il significato della' dimensione' variabile? Sembra diverso da "tot_size". – Kevin
@Kevin https://www.dropbox.com/developers-v1/core/docs/python#DropboxClient.get_chunked_uploader –