【发布时间】:2015-07-25 20:26:48
【问题描述】:
我正在尝试将文件上传到 Google Drive,但使用属性 convert=true 允许将上传文件自动转换为 Google Docs 格式...但它不起作用:
$drive_service = new Google_Service_Drive($client);
$file = new Google_Service_Drive_DriveFile();
$file->setTitle("Informe-imaxbd-alfa");
$result = $drive_service->files->insert($file, array(
'data' => file_get_contents("notas-gdrive.docx"),
'mimeType' => 'application/octet-stream',
'uploadType' => 'multipart',
'convert' => FALSE,
));
文件正确上传但没有任何转换,为什么?
【问题讨论】:
-
对不起,我也尝试过 'convert'=>TRUE,
-
问题与 'mimeType' 放置正确的 mimetype 相关(在本例中为 application/msword,现在转换工作正常。
-
mimetypes 的完整列表在:stackoverflow.com/questions/11894772/…
标签: php google-drive-api