Unable to put a file to a folder
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?
- Put the file to dropbox without any folder.
- Move the file to the destination folder.
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
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.
Code observations
Function put in put.go always takes base of first argument and prefixes with / irrespective of what the argument user passes.
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.
@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.