chunkize
}
// class通过字符串请求解析数据
CHUNK_SIZE = 256 * 1024
DEFAULT_CHUNK_SIZE = 100 * 1024 * 1024
media = MediaFileUpload('/files/test.pdf', resumable=True, chunksize=CHUNK_SIZE)
file_metadata = {'name': 'test.pdf'}
res = drive_service.files().create(
body=file_metadata,
media_body=media,
fields="id"
)
response = None
while response is None:
status, response = res.next_chunk()
try:
sys.stdout.write('%d/%d Bytes transfered' % (status.resumable_progress, status.total_size))
except:
pass
}
// cAlling方法
var app = angular.module("appTradeRoom", []);
app.controller("HomeController", function ($scope) {
这种方式是正确的