Over the last week I’ve been playing around with the DropBox API and have created a CFC which deals with the main DropBox API Calls to allow you to:

  • Get User Account Info
  • Create Folder
  • Get metadata on Folders/Files
  • Upload / Retrieve Files
  • Create Accounts
  • get photo Thumbnails
  • Copy / Move / Delete files / folders

The test file does all the main features, I’ve not got round to fully document it yet. but between the quick tests / examples and the developer docs it shouldn’t take anyone too long to get upto speed.
Just remember to checkout the authResponse.cfm to store the access tokens for future requests to a users dropbox account, rather then to keep authenticating.
I’ve got a couple of plans in the pipe lines on how to use this and hope to post about them soon. But you could use dropbox as a cheaper alternative to S3 ;)
You can get dropBoxCFC from RiaForge here: http://dropbox.riaforge.org/
 

 

12 Responses to dropBoxCFC – DropBox API

  1. dom says:

    time well spent , good job bigmadkev ,

  2. Gary Fenton says:

    I saw this and thought “this is cool, but what can I do with it?” Then I realised that for months I’d been putting PDFs on a website by dropping them into my dropbox, RDP’ing to the data centre and copying the files to the web folder. So your CFC is very interesting, Kev. It would be nice if the API could flag new files that have recently been added, a bit like the Dropbox desktop client.

  3. Big Mad Kev says:

    @Dom Thanks Matey

    @Gary You can get a Hash of the Directory and store this and then check again to see if there is a difference. I’ll need to play more on how this works but that is there in the API

  4. Jibu says:

    After installation i am getting error :
    Element AUTHURL is undefined in AUTHSTRUCT

    Jibu

  5. Jibu says:

    same as above post, sorry for re-post

    I downloaded the files http://dropbox.riaforge.org/

    and i put files in my site folder named dropbox

    file structure is

    -dropbox

    –org

    –uk

    –wwwroot

    —dropBox

    —-Application.cfc

    —-index.cfm

    and i changed in dropbox/wwwroot/dropBox/Application.cfc

    createObject(‘component’,’uk.co.redgiraffes.dropBox.dropBox’).init(consumerKey:’XXXApp keyXXX’, consumerToken : ‘xxxApp Secretxxx’);

    application.authCallBack = ‘http://mySite.com/authResponse.cfm';

    and i run the index.cfm
    http://mySite.com/dropbox/wwwroot/dropBox/index.cfm

    i am getting error

    Element AUTHURL is undefined in AUTHSTRUCT.
    The error occurred in D:\xampp\htdocs\xxxxx\dropBox\wwwroot\dropBox\index.cfm: line 12 10 : 11 : 12 :
    How to solve this error ?
    The installation is correct ?
    i also posted same in dropbox forum http://forums.dropbox.com/topic.php?id=30355&replies=11#post-408823

    thanks,
    Jibu

  6. Jibu says:

    I downloaded the files http://dropbox.riaforge.org/
    and i put files in my site folder named dropbox
    file structure is
    -dropbox
    –org
    –uk
    –wwwroot
    —dropBox
    —-Application.cfc
    —-index.cfm

    and i changed in dropbox/wwwroot/dropBox/Application.cfc
    createObject(‘component’,’uk.co.redgiraffes.dropBox.dropBox’).init(consumerKey:’XXXApp keyXXX’, consumerToken : ‘xxxApp Secretxxx’);

    application.authCallBack = ‘http://mySite.com/authResponse.cfm';

    and i run the index.cfm
    http://mySite.com/dropbox/wwwroot/dropBox/index.cfm

    i am getting error

    Element AUTHURL is undefined in AUTHSTRUCT.
    The error occurred in D:\xampp\htdocs\xxxxx\dropBox\wwwroot\dropBox\index.cfm: line 12
    10 :
    11 :
    12 :

    How to solve this error ?
    The installation is correct ?

    i posted same in dropbox forum
    http://forums.dropbox.com/topic.php?id=30355&replies=11#post-408823

    thanks,
    Jibu

  7. Jörn F. says:

    Hi Kev,

    thanks for you post, but I still have the same problems that Jibu has.

    Is there a quick solution or do I need to debug deeper … ?

    Any answer appreciated.

    Thx in advance.

    Best regards.

    P.S. I saw you at CFCAMp 2012 in Munich – hope you enjoyed it …

  8. Dale Hans says:

    I just downloaded the CFC today and I was having the same issue as Jibu and Jorn. When I examined te error more closely I discovered that DropBox was telling me that I was using an old API and had to use a newer API.
    So in the file where all of the Dropbox URL definitions appear I changed the zeros to ones and it worked, except then it told me I had to use https, not http. I then made that change and I can now get authorized.

    However, when I tried to upload a file I now get an error saying the file name cannot contain double slash marks. I have examined the string of the file name and it does not contain doubled hash marks, only one at each directory.

    Has anyone used this CFC lately? (I see all comments are old and version activity is old) if so, any suggestions?
    Thanks

  9. Dale Hans says:

    Problem solved. DropBox does not like the Windows directory backslashes. So a simple Replace() of slash for backslash prior to upload and it now works fine.

    Thanks for the work Big Mad Kev!!

  10. Manikandan says:

    Just found out the API calls made in the project are out of date and have to be re-written… :(

Leave a Reply to Big Mad Kev Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>