小编Kou*_*uji的帖子

Google云端硬盘(文档)导入错误:图片未在更新的文档文件中显示

嗨Google Drive API支持人员,

在过去的几天里,我们遇到了Google云端硬盘的严重问题.

我们无法再使用图片更新文档文档.当我们的iPhone应用程序发送使用图像更新Docs文档的请求时,服务器返回OK,但内部图像将永远不会上传.

再现问题的代码在这里.

- (void)selfOverwriteSelectedFile:(GTLDriveFile *)gtlDriveFile
{
    // -- not working type -- can't upload images on ODT, HTML, RTF, PDF
    NSString *mimetype = @"application/vnd.oasis.opendocument.text"; //@"text/html" @"application/rtf" @"application/pdf"

    //works: DOCX
    //NSString *mimetype = @"application/vnd.openxmlformats-officedocument.wordprocessingml.document";

    NSString *downloadUrl = [gtlDriveFile.exportLinks additionalPropertyForName:mimetype];

    //1st request: download the file
    GTMHTTPFetcher *fetcher = [self.driveService.fetcherService fetcherWithURLString:downloadUrl];

    [fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error) {
        //2nd request: re-upload the same file
        gtlDriveFile.mimeType = mimetype;
        GTLUploadParameters *uploadParameters = [GTLUploadParameters uploadParametersWithData:data MIMEType:mimetype];
        GTLQueryDrive *query = [GTLQueryDrive queryForFilesUpdateWithObject:gtlDriveFile fileId:gtlDriveFile.identifier uploadParameters:uploadParameters]; …
Run Code Online (Sandbox Code Playgroud)

objective-c google-drive-api

6
推荐指数
1
解决办法
1139
查看次数

标签 统计

google-drive-api ×1

objective-c ×1