Google drive api 使用setConvert在谷歌硬盘上传文件(true);

Google drive api 使用setConvert在谷歌硬盘上传文件(true);,google-drive-api,Google Drive Api,我正试图用setConvert(true)在谷歌硬盘上传文件; 我的代码如下: InputStreamContent mediaContent = new InputStreamContent(mimeType, new BufferedInputStream(new FileInputStream(filename))); mediaContent.setLength(filename.length()); Insert insert = service.files().insert(body

我正试图用setConvert(true)在谷歌硬盘上传文件; 我的代码如下:

InputStreamContent mediaContent = new InputStreamContent(mimeType, new BufferedInputStream(new FileInputStream(filename)));
mediaContent.setLength(filename.length());
Insert insert = service.files().insert(body, mediaContent);
insert.setConvert(true);        
insert.getMediaHttpUploader().setDirectUploadEnabled(false);
insert.getMediaHttpUploader().setProgressListener(new FileUploadProgressListener());
file = insert.execute();
这给了我以下的错误

IOException:com.google.api.client.googleapis.json.GoogleJsonResponseException:500内部服务器错误 { “代码”:500, “错误”:[ { “域”:“全局”, “消息”:“内部错误”, “原因”:“内部错误”
} ], “消息”:“内部错误”
}

身体上有什么?如果未将“转换”设置为true,它是否工作?我无法重现您的问题。body是一个com.google.api.service.drive.model.File类型变量,其中包含有关文件的元数据,如标题、说明、mimetype等。如果不使用setConvert(true),它可以正常工作,但如果我不使用该变量,则使用File.getExportLinks().get(PDF\u File\u type);返回NULL,如果没有PDF下载URL,我无法下载插入文件的PDF。如果是无法转换的mimeType,则可能没有导出链接。您的mime类型是什么?mime类型是application/vnd.openxmlformats-officedocument.wordprocessingml.document或application/vnd.openxmlformats-officedocument.spreadsheetml.sheet或application/vnd.openxmlformats-officedocument.presentationml.presentation,我没有使用不可转换的mime类型,因为前面的代码对于小文件工作正常,但是对于大文件,正如我所问的那样,它给出了错误。我猜转换是一个异步过程,上传完成后转换可能没有完成。让我再和团队确认一下。。。