我可以像这样创建一个快捷方式文件:
gapi.client.drive.files.insert(
{'resource':
{'title': 'shortcut document',
'mimeType': 'application/vnd.google-apps.drive-sdk'}}
).execute();
然后使用生成的 fileId 加载实时文档(类似于 0B0OUnldiyG0hSHQ1Tng2d21lZDg
):
gapi.drive.realtime.load(fileId, onFileLoaded);
我可以成功创建一个真实的文档文件,如下所示:
gapi.client.drive.files.insert(
{'resource':
{'title': 'real document',
'mimeType': 'application/vnd.google-apps.document'}}
).execute();
但是 gapi.drive.realtime.load(fileId, onFileLoaded)
调用会导致 500 错误。文档的 fileId 类似于 1E6IVZeVV6xbeNPeC0BK8RnwgY80a3wRkhtIt5N3ElmU
。
要在非快捷方式文件上加载实时文档,我需要做什么特别的事情吗?
最佳答案
目前您无法在 Google 文档/工作表/幻灯片上创建实时文档。您可以对任何二进制格式执行此操作。
如果您有一些重要的用例,请告诉我们,我们也许能够启用它。
关于google-drive-api - 尝试加载文档文件的实时文档时出现错误 500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18278411/