Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello,
I just installed a Dropbox Plugin for a social network tool called ELGG which uses the Dropbox API. There seems to be a problem with the upload - so I want to ask you, whether you see an error in the following code:
/* Need to be logged in to do this. */
gatekeeper();
/* Get the path. */
$path = get_input('path');
/* Get the file. */
$file = $_FILES['file']['name'];
/* Redirect the user if Cancel is clicked. */
$submit = get_input('submit');
if ($submit == elgg_echo('cancel')) {
forward('pg/dropbox/root/?path=' . $path);
}
/* Upload file procedure */
try {
/* Connection to dropbox. */
$ret = dropbox_connect();
if ($ret) {
forward('pg/dropbox/error/?errcode=' . $ret);
}
$CONFIG->dropbox->putFile($path . '/' . $file, $_FILES['file']['tmp_name']);
system_message(sprintf(elgg_echo('dropbox:upload:uploaded'), $file));
forward('pg/dropbox/root/?path=' . $path);
} catch (Dropbox_Exception_NotFound $e) {
register_error(elgg_echo('dropbox:notfound'));
forward($_SERVER['HTTP_REFERER']);
} catch(Dropbox_Exception_Forbidden $e) {
register_error(elgg_echo('dropbox:forbidden'));
forward('pg/dropbox/root/?path=' . $path);
}
Thanks for help!
What problem exactly do you encounter? Do you get an error message? I can't offer much help with third party plugins of course, but if you are getting an error from the API I may be able to offer some insight.
Hi there!
If you need more help you can view your support options (expected response time for a 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!