新しいBoxサポートサイトへようこそ。 変更点の詳細はこちらをご確認ください .

Malformed file when downloading xlsx file with python sdk

新規投稿

コメント

1件のコメント

  • Rui Barbosa

    Hi Massimo,

    Python open does not close the file automatically, and I suspect it is why your file is getting corrupted.

    Try it like this:

    file_id = '1234'
    
    download_file = client.file(file_id).get()
    with open("/home/wsuser/work/" + download_file.name, 'wb') as transfer_file:
    download_file.download_to(transfer_file)

    The "with"statement will close the file once the download is done.

    0
    コメントアクション パーマリンク

サインインしてコメントを残してください。