【发布时间】:2019-11-10 22:37:48
【问题描述】:
我一直在尝试使用 Duck CLI 在 Windows 10 64 位中将文件上传到 Dropbox。如果我提交如下请求:
call duck --assumeyes --username abcd --password 1234 --upload "dropbox:/Test Folder" "Test.txt"
然后它会提示我输入 OAuth2 令牌,并且会出现一个带有授权代码的浏览器选项卡。我提供这个并开始上传。都好。我想绕过这个并使用我在没有提示的情况下生成的代码。我试过了:
call duck --assumeyes --password <generated key> --upload "dropbox:/Test Folder" "Test.txt"
但我仍然得到提示和浏览器选项卡。我希望整个上传过程没有提示。我错过了什么?
出于兴趣,这是按要求工作的(不发出提示):
curl -X POST https://content.dropboxapi.com/2/files/upload ^
--header "Authorization: Bearer <generated key>" ^
--header "Dropbox-API-Arg: {\"path\": \"<DestinationFolder>\",\"mode\": \"add\",\"autorename\": true,\"mute\": false}" ^
--header "Content-Type: application/octet-stream" ^
--data-binary "@<filename>"
但上传速度只有 1.4Mb/s 左右。使用 Duck 时,速度为 11 Mb/s,因此快了八倍!
【问题讨论】:
标签: file-upload command-line-interface dropbox-api cyberduck