dropbox / dbxcli

A command line client for Dropbox built using the Go SDK
Other
1.05k stars 101 forks source link

`dbxcli get` throw Error: json: cannot unmarshal object into Go value of type string #116

Closed xuqingfeng closed 5 years ago

xuqingfeng commented 5 years ago
» dbxcli version
dbxcli version: v3.0.0
SDK version: 5.4.0
Spec version: 097e9ba
» dbxcli get -v https://www.dropbox.com/s/k1i6reg9y9dqr37/test.md\?dl\=0                                                                                                                255 ↵
2019/01/31 11:38:00 sdk.go:94: arg: &{/https://www.dropbox.com/s/k1i6reg9y9dqr37/test.md?dl=0  map[]}
2019/01/31 11:38:00 sdk.go:94: req: &{POST https://content.dropboxapi.com/2/files/download HTTP/1.1 1 1 map[Dropbox-Api-Arg:[{"path":"/https://www.dropbox.com/s/k1i6reg9y9dqr37/test.md?dl=0"}]] <nil> <nil> 0 [] false content.dropboxapi.com map[] map[] <nil> map[]   <nil> <nil> <nil> <nil>}
2019/01/31 11:38:01 sdk.go:94: resp: &{409 path/malformed_path/... 409 HTTP/1.1 1 1 map[Date:[Thu, 31 Jan 2019 03:38:26 GMT] Content-Type:[application/json] Connection:[keep-alive] Content-Security-Policy:[sandbox allow-forms allow-scripts] X-Dropbox-Request-Id:[26eedc78f8c9b993bc28f07be83b1cb2] X-Robots-Tag:[noindex, nofollow, noimageindex] Server:[nginx]] 0xc0004410c0 -1 [chunked] false false map[] 0xc0000e0e00 0xc0000a4580}
2019/01/31 11:38:01 sdk.go:94: body:
Error: json: cannot unmarshal object into Go value of type string
diwakergupta commented 5 years ago

get expects a path in your Dropbox, not a URL. Try dbxcli ls first, and then see if you can download test.md using the path showed by dbxcli ls.

xuqingfeng commented 5 years ago

I see, thanks.

But it would be very useful if it can download file from a shared link directly.

xuqingfeng commented 5 years ago

Never mind, I can use wget instead.

Ref: https://superuser.com/q/1231332/404872

tashrifbillah commented 3 years ago

Same issue with

dbxcli put myfile https://www.dropbox.com/home

Any comment please?

Edit: I solved it by--

dbxcli put myfile /myfolder/myfile