【发布时间】:2015-07-22 09:34:02
【问题描述】:
我正在尝试将本地 CSV 文件上传到 Google Drive,并在那里像 Google 电子表格一样显示它。但是,当我转到我的 Google 云端硬盘并单击我的文件的链接时,我只能下载它,而不能以电子表格的形式查看它。我试过使用 ?convert=true 但文件没有被转换。我也尝试使用 application/vnd.google-apps.spreadsheet 作为 mime 类型,但注意到更改,否则我收到 400 Bad request response。
异常“Google_ServiceException”和消息“调用 POST 时出错” https://www.googleapis.com/upload/drive/v2/files?convert=true&uploadType=multipart: (400) 提供的 MIME 类型无效 /var/www/html/twittery/lib/google-api-php-client/src/io/Google_REST.php:66 堆栈跟踪:#0 /var/www/html/twittery/lib/google-api-php-client/src/io/Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest)) #1 /var/www/html/twittery/lib/google-api-php-client/src/service/Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest)) #2 /var/www/html/twittery/lib/google-api-php-client/src/contrib/Google_DriveService.php(484): Google_ServiceResource->__call('insert', Array) #3 /var/www/html/twittery/generate_tweets_GSpreadsheet.php(84): Google_FilesServiceResource->插入(对象(Google_DriveFile),数组) #4 {主}
【问题讨论】:
标签: google-drive-api