使用swift 3的Google驱动器api文件上传问题

时间:2017-11-27 06:46:58

标签: ios swift3 google-drive-api

我无法使用swift 3在我的google云端硬盘中上传文件,没有错误,但仍无法上传文件。

 let folder = GTLRDrive_File()
    folder.name = "hellokitty"
    folder.mimeType = "application/vnd.google-apps.folder"
    let query1 = GTLRDriveQuery_FilesCreate.query(withObject: folder, uploadParameters: nil)
    query1.fields = "demo"
    service.executeQuery(query1, completionHandler: {(ticket:GTLRServiceTicket,file:GTLRDrive_File,error:Error?)-> Void in

        if error == nil {
            print("file id",file.identifier as Any)
        }else{
            print("error occured",error as Any)
        }


        } as? GTLRServiceCompletionHandler)

0 个答案:

没有答案