本文介绍了Google Drive Rest Api文件导出限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用rest api" https://www.googleapis.com/drive /v3/files/fileId/export " 参考页"以获取Google文档
I use rest api "https://www.googleapis.com/drive/v3/files/fileId/export" "reference page" to get google Doc
当我尝试获取具有json错误的文件时,我的文档大小约为5 MB:
I have document size ~ 5 MB when i try to get the file i had the json error :
{
"error": {
"errors": [
{
"domain": "global",
"reason": "exportSizeLimitExceeded",
"message": "This file is too large to be exported."
}
],
"code": 403,
"message": "This file is too large to be exported."
}
}
有什么办法可以解决此错误?
Is there any way to fix this error?
推荐答案
您可以在文件:列表:
curl \
'https://www.googleapis.com/drive/v3/files/[FILE_ID]?fields=exportLinks' \
--header 'Authorization: Bearer [ACCESS_TOKEN]' \
--header 'Accept: application/json'
这将返回类似这样的内容(这些是我为Google幻灯片演示文稿获得的链接):
That will return something like this (these are links I got for a Google Slides presentation):
{
"exportLinks": {
"application/vnd.oasis.opendocument.presentation": "https://docs.google.com/feeds/download/presentations/Export?id=[FILE_ID]&exportFormat=odp",
"application/pdf": "https://docs.google.com/feeds/download/presentations/Export?id=[FILE_ID]&exportFormat=pdf",
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "https://docs.google.com/feeds/download/presentations/Export?id=[FILE_ID]&exportFormat=pptx",
"text/plain": "https://docs.google.com/feeds/download/presentations/Export?id=[FILE_ID]&exportFormat=txt"
}
}
这些URL的大小没有严格限制(我能够获得约50mb的PDF)
And those urls don't have such a hard size limit (I was able to get out ~50mb PDFs)
这篇关于Google Drive Rest Api文件导出限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!