GoogleDrive API限制导出限制下载策略10 mb [英] Strategies to GoogleDrive API limit export download 10 mb

查看:480
本文介绍了GoogleDrive API限制导出限制下载策略10 mb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们一直在开发一种解决方案,负责生成嵌入了许多图像的PPT,然后通过Google幻灯片和Google Drive API在浏览器中下载.

We've been developing a solution which is responsible for generating a PPT with a lot of images embedded and then downloading in the browser via Google Slides and Google Drive API.

因此,我们在项目中间发现从Google Drive API导出文件受到限制-当前每个文件10mb.一些PPT应该上面有数千张照片,所以这对我们来说是不对的.

So, we discovered in the middle of the project that there's a limitation on the export of files from Google Drive API - currently at 10mb per file. Some PPT's are supposed to have thousand pics on them, so that's not ok for us.

这是用于导出和下载PPT文件的方法的示例.

Here's a sample of the method used for exporting and downloading the PPT file.

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吗?

Does anyone has a suggestion of solution that can solve this, that keep us using Google API's?

提前谢谢!

推荐答案

要导出不受大小限制的Google幻灯片,您可以使用pptx版本的直接链接:

To export Google Slides without size limit you can use direct link for pptx version:

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

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

这篇关于GoogleDrive API限制导出限制下载策略10 mb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆