Forum Discussion

Anis E.'s avatar
Anis E.
New member | Level 1
10 years ago

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-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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.'s avatar
    Anis E.
    New member | Level 1
    10 years ago

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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-readline-librar

  • Anis E.'s avatar
    Anis E.
    New member | Level 1
    10 years ago

    hmmm i dont have any idea of Ubutnu. Im using a Mac + XAMPP. Any other suggestions how i can figure it out?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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.'s avatar
    dainit p.
    New member | Level 1
    10 years ago

    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

About Dropbox API Support & Feedback

Node avatar for 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!