我正在使用 Google Drive API 下载电子表格类型的文件。除了当我尝试以文本/csv 格式下载它时,这工作得很好。
根据此页面应该支持: https://developers.google.com/drive/v3/web/manage-downloads
所以这段代码工作正常:
var request = gapi.client.drive.files.export({
'fileId': fileId,
'mimeType': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
request.then(function(response) {
console.log(response);
}, function(err) {
console.log('Error');
console.log(err.result.error);
});
这段代码没有:
var request = gapi.client.drive.files.export({
'fileId': fileId,
'mimeType': 'text/csv'
})
request.then(function(response) {
console.log(response);
}, function(err) {
console.log('Error');
console.log(err.result.error);
});
我从服务器收到的错误是:
- 域名:“全局”
- 消息:“内部错误”
- 原因:“内部错误”
有谁知道这可能是什么原因吗?
最佳答案
这是 Drive API v3 的一个已知问题,已向工程团队提出。请关注this issue获取更新。
关于javascript - 从 Google Drive API 导出 csv,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35295257/