We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

axew3's avatar
axew3
Collaborator | Level 8
9 years ago
Solved

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

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]

 

  • 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

5 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    I'm not sure I follow. Can you share the code and output showing this? Thanks in advance!
  • axew3's avatar
    axew3
    Collaborator | Level 8
    9 years ago
    $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's avatar
    axew3
    Collaborator | Level 8
    9 years ago
    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    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's avatar
    axew3
    Collaborator | Level 8
    9 years ago

    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!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 2 hours ago
410 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!