你好谷歌黑客!
我正在使用 Drive Service 应用程序并成功上传文件,如下所示:
require 'googleauth'
require 'google/apis/drive_v2'
Drive = Google::Apis::DriveV2
upload_source = "/User/my_user_name/hacking.txt"
drive = Drive::DriveService.new
# Drive::AUTH_DRIVE is equal to https://www.googleapis.com/auth/drive
drive.authorization = Google::Auth.get_application_default([Drive::AUTH_DRIVE])
file = drive.insert_file({title: 'hacking.txt'}, upload_source: upload_source)
file
有很多属性,比如:
download_url
但是当我尝试download_url
在浏览器中打开它时,它会显示空白屏幕。为什么我不能下载?
我想,那可能是权限问题?但是范围是正确的,上传成功了……