Google drive api 上载的文件不会转换为Google文档

Google drive api 上载的文件不会转换为Google文档,google-drive-api,Google Drive Api,我使用googledriveapi上传新文件(),并使用“convert”参数转换Google文档中的文件 它工作得很好,但今天,上传的文件没有转换。 我尝试了.doc、.docx和.ppt,我也遇到了同样的问题 有人有主意吗?API是否已更改?请确保使用正确的mime类型。请参阅下面的代码 Drive driveService = new Drive.Builder(...).setApplicationName(...).build(); File fileMetadata = new Fi

我使用googledriveapi上传新文件(),并使用“convert”参数转换Google文档中的文件

它工作得很好,但今天,上传的文件没有转换。 我尝试了.doc、.docx和.ppt,我也遇到了同样的问题


有人有主意吗?API是否已更改?

请确保使用正确的mime类型。请参阅下面的代码

Drive driveService = new Drive.Builder(...).setApplicationName(...).build();
File fileMetadata = new File();
fileMetadata.setName("file1.doc");
fileMetadata.setMimeType("application/vnd.google-apps.document");
AbstractInputStreamContent inputStream = new InputStreamContent(null,
                new FileInputStream(new java.io.File("/file1.doc")));
File file = driveService.files().create(fileMetadata, in).setFields("id").execute();

作为信息,上传文件的格式似乎没有被检测到。当我进入drive.google.com时,我们会看到未知文件图标()。当我打开文件并查看详细信息时,mime类型是'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=ISO-8859-1',这与docx文件很好地对应。当我将文件直接上传到drive.google.com时,该文件被识别为具有相同mime类型的Word文件,“application/vnd.openxmlformats officedocument.Word…”。您能发布您提出的具体请求吗?