我想使用curl
将一个zip文件上传到Google驱动器帐户。使用卷曲将zip文件上传到谷歌驱动器
文件成功上传,但文件名未得到更新。它以默认文件名即“无标题”上传。
我正在使用下面的命令。
curl -k -H "Authorization: Bearer cat /tmp/token.txt" -F "metadata={name : 'backup.zip'} --data-binary "@backup.zip" https://www.googleapis.com/upload/drive/v2/files?uploadType=multipart
你需要用卷曲来做吗?如果不这样做,则可以使用'gdrive'命令(http://olivermarshall.net/how-to-upload-a-file-to-google-drive-from-the-command-line/) –
正在运行这在没有空间安装gdrive的路由器上。因此,使我的自定义脚本做到这一点 –
看看这个评论 这个论坛:https://gist.github.com/deanet/3427090#gistcomment-1253229。也许你需要根据这篇文章设置一些变量。 –