GoogleDrive 的策略 API 限制导出下载 10 mb

Strategies to GoogleDrive API limit export download 10 mb

我们一直在开发一个解决方案,负责生成嵌入大量图像的 PPT,然后通过 Google 幻灯片和 Google 驱动器 API 在浏览器中下载.

因此,我们在项目进行到一半时发现从 Google 驱动器 API 导出文件存在限制 - 目前每个文件 10mb。有些PPT应该有几千张图片,所以这对我们来说是不行的。

这里是导出和下载PPT文件的方法示例。

public byte[] downloadPPT() throws IOException {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

    driveService.files().export(getPresentation().getPresentationId(),
           "application/vnd.openxmlformats-officedocument.presentationml.presentation").
           executeMediaAndDownloadTo(outputStream);

    if (googleProperties.getRemovePresentationAfterDownload()) {
        driveService.files().delete(getPresentation().getPresentationId()).execute();
    }

    return outputStream.toByteArray();
}

有没有人有解决方案的建议可以解决这个问题,让我们继续使用 Google API?

提前致谢!

要导出 Google 没有大小限制的幻灯片,您可以直接 link 用于 pptx 版本:

GET https://docs.google.com/presentation/d/<FILE_ID>/export/pptx

参考:https://www.labnol.org/internet/direct-links-for-google-drive/28356/