gpt4 book ai didi

java - 从 AppEngine Java 将 byte[] 保存到 Google Drive

转载 作者:行者123 更新时间:2023-12-01 15:16:49 26 4
gpt4 key购买 nike

byte[] fileItemData = blobstoreService.fetchData(blobKey, 0, 999999);   
ByteArrayContent mediaContent = new ByteArrayContent(fileItemMimeType, fileItemData);
insert = driveService.files().insert(body, mediaContent);
File file = insert.execute();

-> 为什么 insert.execute() 没有捕获异常...?只是什么也不做。-> 当我离开“fileItemData”时,我在谷歌驱动器中得到一个项目。那么它有什么问题呢?我正在尝试上传到 Google AppEngine 并存储到 AppEngine 上的 Google 云端硬盘。

最佳答案

您能否尝试使用较小的数据来编写代码,例如:

ByteArrayContent mediaContent = ByteArrayContent.fromString("text/plain", "Hello World")
driveService.files().insert(body, mediaContent).execute();

请告诉我这是否有效...

关于java - 从 AppEngine Java 将 byte[] 保存到 Google Drive,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11495114/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com