Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello
Is it possible to use the chooser without the selection window ? I would go myself files parameters
ex : list my dropbox's files -> chooser -> get link
i've already try with the PHP api's fonction "createTemporaryDirectLink" but it creates a share link and script execution time is very long
thanks
sorry for my english
No, it's not possible to use the Chooser without user interaction.
The createTemporaryDirectLink method in the PHP is a good alternative then. It returns a link just like the "direct link" type from the Chooser, but can be used completely programmatically. You can then download the file content via the returned link.
Can you share the code that's not working as desired?
# Include the Dropbox SDK libraries
require_once "./../../../lib/dropbox-sdk/Dropbox/autoload.php";
use \Dropbox as dbx;
$appInfo = dbx\AppInfo::loadFromJsonFile("./../../../lib/dropbox-sdk/app-info.json");
$webAuth = new dbx\WebAuthNoRedirect($appInfo, "PHP-Example/1.0");
$authorizeUrl = $webAuth->start();
$dbxClient = new dbx\Client("XXXXXXXXXXXXXXXXXXXXXXXX", "PHP-Example/1.0");
$accountInfo = $dbxClient->getAccountInfo();
//path exemple for the test
$folderMetadata = $dbxClient->getMetadataWithChildren("/images");
for ($i = 0; $i < count($folderMetadata["contents"]); $i++) {
$path = $folderMetadata["contents"][$i]["path"];
$link = $dbxClient->createTemporaryDirectLink($path);
echo '<a href="' . $link[0] . '"><img src="' . $link[0] . '" /></a><br />';
}
This code works fine but if I list 20 images , the page takes 20 seconds to be displayed.
Do you have a solution ?
thank you for your reply
Each call to createTemporaryDirectLink will make another network request, to get the requested information from the Dropbox API, so unfortunately there will be a good amount of overhead for that. I'm afraid I don't have a good solution, but I'll be sure to pass this along as feedback.
Ok thanks, i'll try to find another solution š
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!