cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it 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: 

How i Download all files from the app folder into a specific folder on my server

How i Download all files from the app folder into a specific folder on my server

Anis E.
New member | Level 1

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 10

Greg-DB
Dropbox Staff

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:

https://www.dropbox.com/developers-v1/core/start/php

Anis E.
New 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-DB
Dropbox Staff

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.
New member | Level 1

I'll try this... thanks again mate 🙂

Anis E.
New 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-DB
Dropbox Staff

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:

http://askubuntu.com/questions/182989/how-to-solve-fatal-error-call-to-undefined-function-readline-r...

Anis E.
New 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-DB
Dropbox Staff

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.
New 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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    dainit p. New member | Level 1
  • User avatar
    Anis E. New member | Level 1
What do Dropbox user levels mean?