We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Anis E.
10 years agoNew member | Level 1
How i Download all files from the app folder into a specific folder on my server
Hi,
im not a pro in PHP but i wanna know how to download ALL files from an app folder into a specific folder on my server/ local folder?
For example i use this script on
http://fabi.me/en/php-projects/dropphp-dropbox-api-client/
I hope someone can help me out
THANKS ALOT
10 Replies
- Greg-DB10 years ago
Dropbox Community Moderator
Using the library you linked, it looks like you could use the GetMetadata, Delta, or GetFiles method to get a listing of all of the files you want, and then use DownloadFile to download each file.
Note that we can't provide support for third party libraries like this, but we do have an official PHP Core SDK here:
- Anis E.10 years agoNew member | Level 1
Thanks Gregory,
i'll try this.
but is it necessary to know each file name or is there any method to get all the files automatically downloaded?
- Greg-DB10 years ago
Dropbox Community Moderator
You can get the file listing programmatically using the methods I mentioned in the first part of my previous reply. You can then iterate though the list and download the files.
Likewise, the official PHP SDK also offers ways to get the listing and download files, as shown in the tutorial.
- Anis E.10 years agoNew member | Level 1
I'll try this... thanks again mate :)
- Anis E.10 years agoNew member | Level 1
Hi Gregory,
i tried this and the the following code. dont know whats wront, any idea?
1. Go to: https://www.dropbox.com/1/oauth2/authorize?locale=&client_id=XXXXXXXX&response_type=code
2. Click "Allow" (you might have to log in first).
3. Copy the authorization code.
Fatal error: Call to undefined function readline() in /Applications/XAMPP/xamppfiles/htdocs/newdrop/testapp.php on line 15 - Greg-DB10 years ago
Dropbox Community Moderator
It looks like your system doesn't have readline installed, or it isn't available to your app for some reason. That line of code prompts the user to enter the authorization code they receive from the Dropbox Web site.
That means you just need to install readline (or debug why it's not available to your app) or replace readline with whatever function is available on your platform for accepting input from the user, though that may be specific to your platform so I can't say off hand what the right answer for your system is. For example, here's a post about this for Ubuntu:
- Anis E.10 years agoNew member | Level 1
hmmm i dont have any idea of Ubutnu. Im using a Mac + XAMPP. Any other suggestions how i can figure it out?
- Greg-DB10 years ago
Dropbox Community Moderator
That would be specific to your system, and outside the scope of Dropbox API support so I'm afraid I can't offer detailed steps for installing readline on your system. You'll need to either determine how to install readline, or instead change to using a method available on your system for reading input from the user.
- dainit p.10 years agoNew member | Level 1
Hi,
I have An Error
i tried this and the the following code. dont know whats wront, any idea
fatal error: Call to undefined method Dropbox\Host::loadFromJson() in /opt/lampp/htdocs/dropbox/lib/Dropbox/AppInfo.php on line 150
- Greg-DB10 years ago
Dropbox Community Moderator
dainit p., this looks like a different error/issue than was being discussed in this thread, so please open a new thread so we can help without spamming the other people subscribed here:
https://www.dropboxforum.com/hc/en-us/community/posts/new?community_post%5Btopic_id%5D=200209245
Please include the full error you're getting, as well as your code, and the version of the SDK you're using.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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, Facebook or Instagram.
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!