当我尝试使用 Google Drive .Net Api 检索元数据时,我可以检索 Document Title 但 DownloadUrl for File 是空的,而如果我上传一个新文件则它可用。
这是我正在使用的代码..
Try
Dim authenticator As IAuthenticator = TryCast(Session("authenticator"), IAuthenticator)
Dim service As DriveService = TryCast(Session("Service"), DriveService)
If authenticator Is Nothing OrElse service Is Nothing Then
Return Json("Failed Authenticator", JsonRequestBehavior.AllowGet)
End If
Dim file As Google.Apis.Drive.v2.Data.File = service.Files.Get(file_id).Fetch()
Return Json(file.DownloadUrl, JsonRequestBehavior.AllowGet)
Catch ex As Exception
Return Json(ex.Message, JsonRequestBehavior.AllowGet)
End Try