cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Behavior: create_folder do not share a subfolder, if path_lower contain chars like ' . And happy NY!

Behavior: create_folder do not share a subfolder, if path_lower contain chars like ' . And happy NY!

axew3
Collaborator | Level 8
Go to solution

Just 1 hour after 00 of the last day on 2016 ... Happy New Year to all! Finally 2017 is coming!

 

My last 2016 problem 🙂  ... maybe as always due to the fact i've not well read/understand something ...

 

I found that calling create_folder to create a folder on ROOT naming the folder like this, with the ' char inside:

/my''''folder

all work as expected. The folder is created, and shared immediately correctly.

But if after i navigate inside the created folder my''folder, and i try to curl, to create inside it another folder, naming it with or without a char ' inside, so for example, we will have something like:

/my''''folder/mysec''ond''folder

or /my''''folder/mysecondfolder

The folder is correctly created in dropbox. But will not result as linked/shared immediately.

some conflict that i should know exist, or why this behavior?

 

[EDITED]

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
Apologies, this is still hard to follow without seeing the actual API call code, that is, seeing what API endpoints you're calling, and seeing the output you're getting, along with an explanation of the output you're expecting to get.

For example, are you only calling the /files/create_folder endpoint? That endpoint only creates folders. It doesn't share them automatically.

If you'd rather not post publicly, you can open a ticket here:

https://www.dropbox.com/developers/contact

Please include:

- the name of the API app
- the full text of the output/behavior you are getting
- the output/behavior you expect to get
- the relevant code

View solution in original post

5 Replies 5

Greg-DB
Dropbox Staff
Go to solution
I'm not sure I follow. Can you share the code and output showing this? Thanks in advance!

axew3
Collaborator | Level 8
Go to solution
$data_s = stripslashes($data_s);
$data = '{"path":"' . $data_s .'"}';

$data now contain the follow:

{"path":"/dfgdfdf'''fgff/gdgdfgdg'''gfff"}

or

{"path":"/dfgdfdf'''fgff/mysubfolder"}

$data is so passed to CURLOPT_POSTFIELD

while  CURLOPT_HEADER contain :

Array ( [0] => Authorization: Bearer hsQbEz.................lhyP_EsRPf..........d1XkgMdJ.........fdgdgf [1] => Content-type: application/json )

Yes i know you can imagine the above. But in effect it is just passed simply in this way. The sub-folder willbe created, but not shared.

The same happen also if the subfolder to be created inside the folder

/dfgdfdf'''fgff

do not contain chars  like '.

I could name it also aaaaaaa: will be created, but if it is subfolder of

/dfgdfdf'''fgff

won't be shared.

I would like to post entire code, but as it is on the way to be released as part of a plugin in these days, maybe is possible to post it somewhere else?

axew3
Collaborator | Level 8
Go to solution
p.s is possible in case to patch this, informing user that the parent ROOT folder contain chars that not allow to create after inside him, another folder and have it shared immediately. Little strange but easy to achieve. Just thinking on how to patch in case this in the while. And will change it when resolved, if it is to be resolved in case.

Greg-DB
Dropbox Staff
Go to solution
Apologies, this is still hard to follow without seeing the actual API call code, that is, seeing what API endpoints you're calling, and seeing the output you're getting, along with an explanation of the output you're expecting to get.

For example, are you only calling the /files/create_folder endpoint? That endpoint only creates folders. It doesn't share them automatically.

If you'd rather not post publicly, you can open a ticket here:

https://www.dropbox.com/developers/contact

Please include:

- the name of the API app
- the full text of the output/behavior you are getting
- the output/behavior you expect to get
- the relevant code

axew3
Collaborator | Level 8
Go to solution

Well what shame .... how i can say ... ah yes! this is my stupid mess ... i had a call, separated, to create_shared_link_with_settings that i've forget to check for proper sanitization ... thus the code was failing.
Some party more in this time maybe, between christmas and the new year ... you can understand i hope 🙂

By the way, the strange i will try understand, that maybe still result strange to me is: if the folder was on root, by the way it was created and shared, also if not escaped.
While the sequential subfolder not.
So i'll return over this, and let know in case, as well providing all the code, as the plugin will be released if i still have not detect how this was happening and reporting the reason.

In the while, Thank you Greg. Wish you a Nice 2017!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    axew3 Collaborator | Level 8
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?