dropbox / dbxcli

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

Unable to put a file to a folder #122

Open ghost opened 5 years ago

ghost commented 5 years ago

What was the activity?

Upload a file from desktop to existing remote folder.

foobar@my_pc ~ $ dbxcli-linux-amd64 put Downloads/2019-05-20.pdf /bills-0000000000/ Uploading 32 KiB/32 KiB Error: path/conflict/folder/.. foobar@my_pc ~ $ dbxcli-linux-amd64 put Downloads/2019-05-20.pdf /bills-0000000000/. Uploading 32 KiB/32 KiB Error: json: cannot unmarshal object into Go value of type string foobar@my_pc ~ $ dbxcli-linux-amd64 put Downloads/2019-05-20.pdf /bills-0000000000 Uploading 32 KiB/32 KiB Error: path/conflict/folder/.

What was observed?

All commands failed to upload.

What is the version used?

dbxcli version: v3.0.0 SDK version: 5.4.0 Spec version: 097e9ba

What is the environment?

ClearLinux distro with Linux my_pc 5.0.17-765.native #1 SMP Mon May 20 17:08:30 UTC 2019 x86_64 GNU/Linux

What was expected?

File is put to the folder successfully.

What was the work around applied?

  1. Put the file to dropbox without any folder.
  2. Move the file to the destination folder.
hsehdar commented 5 years ago

Another work around

Give the file name in the destination like dbxcli-linux-amd64 put Downloads/2019-05-20.pdf /bills-0000000000/2019-05-20.pdf

ghost commented 5 years ago

Code observations

Function validatePath(p string) in root.go trims p always.

I suppose it should retain directory name if p has it. If p does not has prefix / then only prefix it.

ghost commented 5 years ago

Code observations

Function put in put.go always takes base of first argument and prefixes with / irrespective of what the argument user passes.

Yostage commented 4 years ago

I hit this too. You can work around it by appending a filename to the target, but the bigger problem to me was that it did the full upload (15 GB) and then failed at the end.

mrichman commented 4 years ago

@Yostage I just hit the same issue. I uploaded 17 GB just to learn that I had to specify a filename, not just a directory, as the target.