用python将大文件上传到Google云存储的最快方法?

2024-09-29 23:18:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个大约20GB的大CSV文件,我需要上传到谷歌云,这是一个巨大的文件,不是拆分的。如何快速上传?以下是我所拥有的:

def WriteFile2Cloud(filepath, filename):
    global config
    global debug
    if(debug):
        print("Writing to file: "+filename)
    session = GetSession()
    client = storage.Client(config.GoogleProjectID(), _http=session)
    bucket = client.get_bucket(config.GoogleBucketName())
    blob = bucket.blob(filename)
    file = blob.upload_from_file(filepath+"/"+filename)

有没有办法加快文件上传速度


Tags: 文件csvdebugclientconfigifbucketsession

热门问题