Google drive api 如何获得上传到谷歌硬盘上的PDF文件的thumnail?

Google drive api 如何获得上传到谷歌硬盘上的PDF文件的thumnail?,google-drive-api,Google Drive Api,我能够上传一个文件到谷歌驱动器使用谷歌SDK。但是我收到的响应不包含“thumbnailLink”字段 我想为通过我的应用程序上传的每个文件显示预览图像。我该怎么做呢 这是我的申请代码: File driveFile = new File(); driveFile.setTitle("File Title"); driveFile.setMimeType(userFile.getContentType()); FileContent driveFileContent = new FileCon

我能够上传一个文件到谷歌驱动器使用谷歌SDK。但是我收到的响应不包含“thumbnailLink”字段

我想为通过我的应用程序上传的每个文件显示预览图像。我该怎么做呢

这是我的申请代码:

File driveFile = new File();
driveFile.setTitle("File Title");
driveFile.setMimeType(userFile.getContentType());

FileContent driveFileContent = new FileContent(userFile.getContentType(), userFile.asFile());                
File insertedDriveFile = driveService.files().insert(driveFile, driveFileContent).setConvert(true).execute();
以下是我的回答:

{
    "alternateLink" : "https://docs.google.com/file/d/...",
    "createdDate" : {
        "dateOnly" : false,
        "tzShift" : 0,
        "value" : 1345031115877
    },
    "description" : "Some Text",
    "downloadUrl" : "...",
    "editable" : true,
    "etag" : "\"qZporUffWgr4KlPui79y_IN18w8/MTM0NTAzMTExNjI1OA\"",
    "fileExtension" : "",
    "fileSize" : 15666,
    "id" : "0B4FbUv8OusD1Q3V2aFM2M2pVaEk",
    "kind" : "drive#file",
    "labels" : { "hidden" : false,
        "restricted" : false,
        "starred" : false,
        "trashed" : false,
        "viewed" : true
     },
    "lastModifyingUserName" : "Regis Bamba",
    "lastViewedByMeDate" : { "dateOnly" : false,
    "tzShift" : 0,
    "value" : 1345031115769
  },
    "md5Checksum" : "0baac1165bd1a004fa52eb9777e455df",
    "mimeType" : "application/pdf",
    "modifiedByMeDate" : { "dateOnly" : false,
        "tzShift" : 0,
        "value" : 1345031116258
      },
    "modifiedDate" : { "dateOnly" : false,
        "tzShift" : 0,
        "value" : 1345031116258
      },
    "originalFilename" : "Test File",
    "ownerNames" : [ "Regis" ],
    "parents" : [ { "id" : "0AIFbUv8OusD1Uk9PVA",
          "isRoot" : true,
          "kind" : "drive#parentReference",
          "parentLink" : "...",
    "selfLink" : "..."
  } ],
  "quotaBytesUsed" : 15666,
  "selfLink" : "...",
  "title" : "Test File",
  "userPermission" : { "etag" : "\"qZporUffWgr4KlPui79y_IN18w8/S0oJPFvxJQWU-e8QPUGRAAa4JaA\"",
  "id" : "me",
  "kind" : "drive#permission",
  "role" : "owner",
  "selfLink" : "https://www.googleapis.com/drive/v2/files/0B4FbUv8OusD1Q3V2aFM2M2pVaEk/permissions/me",
  "type" : "user"
},
  "webContentLink" : "https://docs.google.com/uc?id=0B4FbUv8OusD1Q3V2aFM2M2pVaEk&export=download",
  "writersCanShare" : true
  }      

谢谢

缩略图创建过程是异步的,因此文件上载调用返回的元数据中不包括
thumbnailLink
字段。稍等片刻后,尝试检索同一文档,该文档应包含该字段。

缩略图创建过程是异步的,因此文件上载调用返回的元数据中不包含
thumbnailLink
字段。在一小段等待后尝试检索同一文档,它应该包含该字段。

您能向我们展示您的请求和响应吗?我刚刚试过OAuth游乐场,缩略图是为PDF返回的。嗨,Claudio,我也试过OAuth游乐场和PDF,但它也没有返回缩略图。但是我会用我的请求和回复更新这个问题。你能给我们看看你的请求和回复吗?我刚刚试过OAuth游乐场,缩略图是为PDF返回的。嗨,Claudio,我也试过OAuth游乐场和PDF,但它也没有返回缩略图。但我会用我的请求和回答更新这个问题。