Dropbox plugin for wordpress

New post to go with a new version of the plugin. Click here.

There seems to be a demand for a wordpress plugin which can handle dropbox and there is code available to make it, but for some reason people haven’t made one yet.

Taking the available code and next to no wordpress plugin knowledge I’ve modified the code and made a plugin out of it.

It’s now been what I would consider sufficiently tested, and appears to work for most configurations.

Long story short, a special thanks to jaka.kubje.org and to individual-it.net from where the bulk of the code originates. I just made it a plugin.

There is a readme file in the archive which should explain the workings. It’s basic and simple, but if any questions come up, post a comment and I’ll gladly answer.

010 – Added option to show file size. Added option to show date and time of last modification
009 – Fixed to work with the new dropbox url. Fixed a problem with the permalinks. Added shortcodes
008 – Switched to the new way of storing options. Might be compatible with wordpressMU. Need volunteer to find out.
007 – Security update restricting acces to plugin settings. Please update if you have a multi-user blog.
006 – suffice to say I’m embarrassed about this one but the password should no longer get messed up
005 – files with spaces in the names should no longer be truncated thanks to a delightfully simple fix.
007 – Security update restricting acces to plugin settings. Please update if you have a multi-user blog.
006 – Fixed obvious mistake in password code.
005 – Files with a space in the name now mostly work.
004 – fixed URL bug
003 – updated the dropbox connection class
002 – updated the dropbox connection class

Browser issues as noted so far:

  • Chrome – like a charm
  • Firefox – works
  • IE8 – also woks
  • Safari – works on the latest version
  • Opera – haven’t tested much but seems to work
  • Epiphany – untested

Click Here to Download the latest version

Demo – browsing and downloading only

Download older versions here:001,002,003

New post to go with a new version of the plugin. Click here.

VN:F [1.9.22_1171]
Rating: 7.1/10 (12 votes cast)
Dropbox plugin for wordpress, 7.1 out of 10 based on 12 ratings
  • Vince H.

    Thanks for providing this plugin Andrew. :) I’ve installed it, but it isn’t clear, in the documentation, where I should enter my dropbox login information, or how I choose which folder I’d like the content to be uploaded to… Is this something I’ve just overlooked?

    Thanks again.

    • http://software.o-o.ro Andrew

      Hello Vince

      There should be a “TDP options” menu under your options. Stands for “The dropbox Plugin”, very unimaginative I know. The login information goes there. Unless I’ve uploaded the wrong version you can choose a folder there as well.

      Thanks for giving the plugin a try, hope it works well. If it doesn’t let me know and I’ll see what I can do. ;)

  • http://adjenz.com Aaron

    I can’t seem to get plug-in to display files, just directories. I have tested all the php examples on dropbox’s wiki and there all no go. Any luck? Can you provide a test example? Hit me back with an email if you can, thx.

  • mc ns

    Thank you much for that informational blog post.

  • http://software.o-o.ro Andrew

    Aaron you seem to be right, I’m not exactly sure why this is, must be something on dropbox’s side. I’ll try to look into it in the next few days.

  • http://adjenz.com Aaron

    Thanks for your time. This is pretty huge to me. I’m hoping to use this to replace an old ASP upload script I used and is now useless since my server doesn’t support ASP. Plus, uploading files then syncing to my local machines would be very slick.

  • Vince H.

    Hi Andrew,

    I got the option thing figured out (thanks!), and then installed the plugin. Unfortunately, I got this error when trying to upload a file to the dropbox:

    Error: Cannot execute request: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed



  • Vince H.

    Ok, so I figured out why I got that error on Jaka’s site. It wasn’t clear, however, where I should insert the php code he mentioned, so I put it in there and pointed to the certificate, but I don’t think it worked. The error disappeared, but the upload definitely didn’t work.

    No worries if you can’t help on this, but I was just wondering if you’ve dealt with this on your server, and if so how did you install the certificiate?

  • http://software.o-o.ro Andrew

    Seems version 3 of the dropbox connection class came out when I wasn’t looking. I’ve made the update and it should work now.

  • http://adjenz.com Aaron

    v002 fixed the errors I was having, nice! Still not listing the files for anonymous viewing… wish the author of the Dropbox connection would update it. Is it just me?

  • Pingback: Dropbox Plugin für Wordpress « individual-it.net Blog

  • http://adjenz.com Aaron

    IT NOW WORKS!!!! Get the new DropboxConnection on the individual-it.net link at the top! I can see files & folders listed for anonymous viewers!! Sorry, i’m really excited…waited months for this to work!

    Don’t know if the plug-in works yet, tho.

    • http://software.o-o.ro Andrew

      I’ve updated the plugin and it should work now.

  • http://adjenz.com Aaron

    I found a glitch, if there is a space in the FOLDER name, take the space out and it will display the files. I’m guessing something with the %20 / Space HTML conversion maybe?

  • http://software.o-o.ro Andrew

    Yup that’s the issue. I fixed this one in the original release (or the prerelease) but forgot to reapply the modifications. It should work now.

  • http://adjenz.com Aaron

    Great work and congrats to see your plug-in is on WordPress’s site! OK, one last bug that is still not working right. When I try to download a file with a SPACE in it, the file gets truncated at the space and no file extension. I.E. “My Book.doc” gets saved as “My”

    Tested in FF 3.5.3 & IE8 on Win7 RTM (x64). I can upload a file with a SPACE file, I can see the file with a space fine, just can’t properly download it.

    • http://software.o-o.ro Andrew

      Aaron, I’ve taken the liberty of visiting your blog and tracking down the dropbox plugin. I’ve found a file named TV Wants.xlsx And results are:

      Chrome had no problems
      Safari much as expected turned out some odd results, haven’t updated it in ages though.
      IE8 works fine
      I was able to recreate the issue in Firefox 3

      All this under win xp sp3

      This seems to be a browser-specific issue, I’m not entirely sure what I can do about it. Are the file contents compromised or intact?

  • http://adjenz.com Aaron

    First off, I am very appreciative that you are taking the time to fix this issue. Second, I know you didn’t write the DropboxConnection, but again… happy you are improving it in a way that will work for everyone.

    After reading what you said, it is messing up FireFox completely. I gathered some portable version of FF and IETester to help testing.

    FF3 & FF3.5.3 (Win7), if I click on the “TV Wants.xlsx” link directly, for me, the filename gets cut to just show “TV”…no extension. Now if I right click, Save Link As, I get the full filename BUT the extension gets changed to .HTM
    FF2 (WinXP SP3) – Same as above
    Chrome (WinXP SP3) works 100% both ways – We can agree on that.
    IE8 (Win7) I guess it is working too, but both ways it converts the SPACE to an underscore. TV_Wants.xlsx – Doesn’t bother me, hate IE
    Safari – I’ll test it later on my Hackintosh, not concerned

    Either way I download the file, the data is never corrupted, just needs to be renamed afterwards. Before applying your fix v004, my filesize was 0 bytes.

    To conclude, now that we discovered this issue a little more, I want to figure out why it is acting up in FireFox. Sounds like adding some form of “type” in the link or something should fix it, at least for Right-mouse – Save link as.


    • http://software.o-o.ro Andrew

      It turned out to be a common firefox issue with a simple fix. It seems to have worked for IE and Opera also, also the new Safari is working. I’ll test it out on epiphany when I get the chance.

      Once again it should be working now. :D

      Thank you very much Aaron for the testing. Please let me know if you find other things wrong.

  • http://adjenz.com Aaron

    Couldn’t be happier! Great work. You may want to post this on Dropbox’s own Wiki. That is where I started looking for a WordPress plug-in and found many other useful add-ons.

    w00t, now I can go ahead and style it.

  • Tnelson

    There’s good info here. I did a search on the topic and found most people will agree with your blog. Keep up the good work mate!

  • http://www.ateljedigital.se Joakim Eriksson

    This is so good! It will help we with a big issue I had on one of my homepages with a no-computer-user friend who wants to add files to his homepage.

    But.. I get the “Viewing: Error: Login unsuccessful.” message.
    But as far as I can see, theres nothing wrong with my username/password.
    Do I need to do anything on the dropbox-side. Or what could be wrong?

    Please help!

    Keep up the good work!

    • http://software.o-o.ro Andrew

      Hello Joakim.

      I’ve noticed that sometimes the password gets messed up when fiddling with the settings. A fix would be to either retype your password and save the options or to type your password again when making any changes. As a general rule I don’t recommend using the upload form from the admin menu at the moment.

      I’ll work to fix it sometime in the next few days, but for the moment type in your password again and let me know if it works/doesn’t work.

  • http://www.ateljedigital.se Joakim Eriksson

    Hi Andrew!
    Thanx for taking your time to answer!
    I’ve tried both. Changing pass from the cinfig page, and manually.
    I even tried the original DropboxConnection with the same result. Adressing the very page (Not going through WordPress)

    I have a number in my password, so I tried changing it to “testar” (testing in Swedish) but the same result.

    Could it have something to do with the “Public” folder you mentioned? I tried with a “test”-folder. But didnt know how to make i root, or did you mean simply put that folder as the on in the config?

    Again, thanx for your time

    • http://software.o-o.ro Andrew

      On the demo page I’ve used the “/photos” folder. I’ve just made a quick test leaving it blank, and managed to access the public folder, so that shouldn’t be the issue.

      What browser and version of wordpress are you using? Also do you happen to use any non-standard characters in your email/ password/ folder names? I’m almost sure this is a useless question, but are you sure you’ve installed the latest version of the plugin (005)?

  • http://www.ateljedigital.se Joakim Eriksson

    Got it!

    I was to quick. I manually hard-coded the email and pass in the config file before uploading it to the server.

    $dbdir = get_option(‘tdp_dir’);


    $dbdir = get_option(‘Public’);

    Ofc WordPress couldn’t get THAT data from the database! :-)

    But now it works like a sharm. SUPER Thanx for your work!!!

    I will soon tip about this plugin on my “10 WordPress plugins you can’t be without” on my http://www.ateljedigital.se . it will be in swedish though (I think).

    Good work!!!

  • http://www.ateljedigital.se Joakim Eriksson

    next problem :-)
    I got the “list” working. But I can’t click the links.
    It just says it’s not there.

    I checked your demo-page. The thing that differs is this.
    First ifI put my Publics folder. If you point the link to see the url in the status-bar. I dont have the hex-code after “…&w=”. You have that on your photo-demo.

    So i change to my photo folder.
    I get the code after the “w=” but it wont work.

    Bottom right corner
    I have no idea whats wrong :(

  • http://software.o-o.ro Andrew

    A similar happened to me when I was testing the plugin using the preview option for the page the demo is currently on. If you place the plugin on its own page it should work. I think there’s some issue with sending the headers. I’ll look into it now.

  • http://www.vvor4.nl VVOR

    You should post some screenshots on the wordpress.com/extend page :)

    Tnx for the plugin!

    • http://software.o-o.ro Andrew

      Thanks for the suggestion I’ll do that as soon as I have a few moments.

  • RobD

    what a great site and informative posts, I will add a backlink and bookmark your site. Keep up the good work! :)


    HI, I was triying to use the pluggin but i cant get it to work right.
    The upload function in the dashborad works fine, so i thing the username and password should be ok.
    I am using WordPress 2.8.
    I configured the TDP just like the example, but when i create a page to display the dropbox directories it doesnt show anything.

    • http://software.o-o.ro Andrew


      Php code might be weeded out by your wordpress (it’s a default thing). You can grab a nice plugin that enables it for you here: http://bluesome.net/post/2005/08/18/50/

      The next version will have a more user friendly way of adding it to your pages.

  • xavier

    Hi Andrew, i installed the pluggin and it now display the file listings, but when i click on a file to download, it doesnt download the file, it just refresh the page, even when i try the save to option.

    • http://software.o-o.ro Andrew

      Are you trying to display it on a separate published page? If you test it in preview mode it behaves as you describe.

      If that’s not it either could you link me to your blog so I can look around and try to find the issue?

      • http://www.morsarefaccionarias.com Xavier

        Yes it is in a separate published page, and it seems to be working right, but when click on a link, it keeps refreshing the page.

        • http://software.o-o.ro Andrew

          Think I know what the problem is and I’ll make sure to fix it in the next release.

          Meanwhile a workaround might be going to Settings->Permalinks in the admin menu and using any setting other then the default one.


          • http://www.morsarefaccionarias.com Xavier

            I change the permalinks option, but now i ahve another problem, i think is the same than Joakim Eriksson, i cant get the code after the &w, and when i click on a link it says: “impossible w-string”

            • http://software.o-o.ro Andrew

              I’m looking into it now, however I’m unable to replicate the error. The only time I remember getting it was when the Dropbox Connection class was outdated.

              While I’m trying to see if I can track down this elusive bug, could you please make double sure you have the latest version of the plugin installed? Also the version of php you have and the wordpress version might also help.

              If all else fails I could try giving you some debug versions of the files to help track it down better.

            • http://sadnem.is-gorgeo.us Sadnem

              I´m getting the same error, tdp plugin last version is installed and i´ve just ran an apt-get upgrade to check if php was outdated, still getting the same error, I could send you the debug logs if you send me the debug version.

            • http://www.rudolffehrmann.nl Rudolf

              impossible w-string

              There seems to be an error. I’ve installed the most recent version of wp. Hopefully, you can resolve this issue.


  • Chris J

    I have installed WordPress and its great and also installed the Plugin and activated it. The page is under settings and TDP settings. How can I get it on one of the pages? I put both code in and it does nothing.


  • Chris J

    I gotten to the added page and it seems to work except the CA certificate error. I have placed a certification.cer file in main httoc folder and I know that I need to point Dropbox uploader but where do I put that line of code? I am using the plugin and I am able to edit it within WordPress.

    any help would be appreciated


    Chris J

    • http://software.o-o.ro Andrew


      I assume you mean the this certificate file fix line

      What you need to do is find these lines in the main php file:
      // Upload
      $uploader = new DropboxConnection($dbemail, $dbpassword);
      $uploader->upload($tmpFile, $dbdir . “/”. $_POST['dest']);

      and add the fix line between them so it’ll look like so:
      // Upload
      $uploader = new DropboxConnection($dbemail, $dbpassword);
      $uploader->upload($tmpFile, $dbdir . “/”. $_POST['dest']);

  • Chris J

    Thanks Andrew

    You are a big help.. I tried it in different places.. I am working on it now and will let you know


    Chris J

  • Chris J

    Well, I am still a noobie here.

    Heres the error:

    Error: Cannot execute request: error setting certificate verify locations:
    CAfile: /Applications/MAMP/htdocs/certification.cer
    CApath: none

    Heres my edit line:

    Heres my total string:
    $uploader = new DropboxConnection($dbemail, $dbpassword);
    $uploader->upload($tmpFile, $dbdir . “/”. $_POST['dest']);

    Do you see anything wrong with this?

    Thanks so much for your hard work

    Chris J

    • http://software.o-o.ro Andrew

      I’ve done a bit of searching and I might know what the issue is. Try setting the permissions of the certification.cer file to 755.

      Let me know how that works out.

  • Chris J

    on my Mac 10.5 machine, i am able to add any user or name like 755. But my 10.4 I am not able to. Just it has ‘others’ included as able to read and write.

    But it doesn’t work. I tried others dropbox uploader script but your plugin is the only one that I am able to have a web page with the upload feature. The others always has an error.

    So I am still at this error: Error:
    Cannot execute request: error setting certificate verify locations:
    CAfile: /Applications/MAMP/htdocs/certification.cer
    CApath: none

    Does this cert file needs to be in aparticular area? I am using MAMP so I can have it on a localhost. I am not hosting it anywhere but local. MAMP has a htdocs folder thats where wordpress files are. I have tried different areas for the cert file but to no avail. I appreciate all your help. But this is where I am at. It would really help to provide an upload feature for my type of work

    Thanks again

    Chris J

    • http://software.o-o.ro Andrew

      Of what I gather that error is the result of the script somehow failing to red the certificate file. Running it locally might mean there’s an easier fix.

      You can try to undo the code changes I mentioned earlier and install the certificate by using this guide: http://help.godaddy.com/article/5243

      I’m not sure if it’s exactly what you need since I’m not a Mac user, but let me know if it works/ doesn’t work. Sooner or later we’ll get to the cause of this :D

  • Chris J

    Thanks Andrew.

    well, I couldn’t get it to work. I tried on two different Macs. My 10.5 Mac, the Keychain app stalls and freeze when I try to import the certificate. The 10.4 Mac, it doesn’t do anything. Doesn’t import. So I am back to square one.

    Thanks for trying and if any other ideas, I am all ears.

    FYI the info on the certification that I use I got from here:

    Chris J

  • Chris J

    Whoohoo Andrew

    I found the issue. The certificate itself is not good. I found an certificate inside a package for Dropbox Uploader by Jaka

    Heres the link for anybody else that needs it.


    The only error I have it says login unsuccessful. but I imagine that will be an easy fix

    Thanks for heading me in the right direction

    Chris J

  • Chris J

    I am still getting the error:
    Error: Login unsuccessful.

    I checked the setting under TDP and input the user and pass.
    also edit the pluggin under file dropbox-plugin/tdp_config.php
    with the same info

    any ideas?


    Chris J

  • http://firefly-nexus.org GhostLyrics

    I am very sorry to tell you that I don’t know why someone gets the w-string error mentioned above. However I can show you how to reproduce it. Just try to append your code to a subdirectory within the ‘Public’ folder of your dropbox account. After I changed my directory structure to have my files in the ‘private’ area it worked without the w-string errors.

    • http://software.o-o.ro Andrew

      Thanks a lot. Previous versions of the plugin did that with the public folder itself. I thought it was fixed when I updated the dropbox connection class.

      In a couple of days when I put the ‘new’ version up I’ll double check that I’m using the latest version of the class as well.

      Till then I recommend you make a non-public folder and use that.

    • http://www.morsarefaccionarias.com Xavier

      Thanks a lot, it works great now, !!

  • Pingback: Firefly-Nexus » Blog Archive » Dropbox für Wordpress & Übersetzungen

  • Chris Griffin

    It appears that the plug-in – and the originating code from jaka.kubje.org and individual-it.net – have stopped working. Any time a connection is attempted to Dropbox, an error message results:

    Error: Cannot extract token! (form action=/login)

    This error appears on your demo page as well.

    Has Dropbox changed it’s authentication method again? Is there a workaround or quick fix you can suggest?

    • http://software.o-o.ro Andrew

      Thanks for bringing this to my attention.

      I’ve not poked the connection class much but I’ll try to see if I can fix it myself. By the time I figure out how to do that it’ll most likely be fixed by one of the two, as they’re more experienced with their own code. I’ll keep an eye out for any fixes and will release an updated version as soon as I get it working or find a working version.

      For the moment I’m sorry for the inconvenience.

      • Chris Griffin

        FYI – Part of the problem is the the folks at dropbox just changed their url from getdropbox.com to plain old droppox.com. I updated this url throughout the connection class and that particular error went away. However, now I’m getting new SSL Certificate errors. Oh well…

  • http://adjenz.com Aaron

    Would it be possible to add the filesize and also date modified to the output? Dropbox’s web version does it. Hoping it may be easy to pull those attributes out and display them on the anonymous dropbox file list.

    Thanks Andrew. Appreciate your work on all 9 versions so far.

    • http://software.o-o.ro Andrew

      I’ve just added those features. Thanks for the suggestion and please let me know if you have more :D

  • http://www.renaudmerle.fr Renaud Merle


    I upgraded the domain from ‘getdropbox.com’ to ‘dropbox.com’ and I got the SSL error.
    I just tried with an other (new?) certificate and it runs smoothly. You can download it here : http://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Certificate_Authority.cer

    (It’s a different certificate than the *CA-1.cer)


  • http://www.cjwworld.07x.net/ Chris J


    I feel I am just so close to get this Dropbox plug-in to work. Still come up with Error: Login unsuccessful.

    I tried GhostLyrics suggestions. But maybe I misunderstood. I changed directory to public folder.

    I also updated the plugin whereas the new DB url is updated but to no avail.

    I have a question. in the config,php and the TDO settings what would you put in directory tree? If you want the directory to start in the public folder? would you just put public or would you put slash before public like this: /Public ?

    thanks for your hard work

  • http://www.cjwworld.07x.net/ Chris Jones

    Thanks Andrew.

    Well, it didn’t work still, no illegal characters in pass. just letters and numbers. I checked the settings it seems a zillion times..

    Thanks for you time tho.. any other ideas, give it a shot.


    Chris J

    • http://software.o-o.ro Andrew

      Hmm, have you tried editing the config file and adding your email and password there manually?

  • http://www.cjwworld.07x.net/ Chris J

    Yes, I have done that manually. Its in the TDP settings as well.

    Heres what I inputed in config file

    $dbdir = get_option(‘/Public/Update’);

    is the quotation marks after the input correct?

    I appreciate all you do. I probably have a rare issue. here.

    I do not have illegal characters in pass. just made of misture of letters and numbers.


    chris j

    • http://software.o-o.ro Andrew

      get_otion(“text”) gets the contents of an option named “text” which has to be previously set. Since I’m pretty sure your wordpress installation didn’t set any options with the names of your email and password it’s getting null values from it, sending them to the plugin and you’re essentially trying to log in without an email nor a password.

      To fix it you should write it like this:

      $dbdir = ‘/Public/Update’;

      If that doesn’t work you can try it with “//” instead of the simple “/”s. If that doesn’t work either… well.. let me know and we’ll see. :D

  • http://www.cjwworld.07x.net/ Chris J

    another thought, do you suppose my hosting service, is hindering this? I am using WordPress.


    chris j

    • http://software.o-o.ro Andrew

      Oh wait.. you’re hosting this on wordpress.com? I wasn’t aware they allow user plugins. Also I’m not sure they have curl available.

  • http://www.cjwworld.07x.net/ Chris J

    No, I am not hosting it on wordpress.com.. I am using their database and source files for website. I am hosting it on .o7x.net.

    I will try your other ideal


    Chris j

  • http://www.cjwworld.07x.net/ Chris J


    It worked.. You are splendid!.. Great work.. whoohoo. Now I can celebrate tonight.. wow..Just what I wanted

    thanks a million Andrew

    Chris J

    • http://software.o-o.ro Andrew

      Oh thank goodness. Finally! :D

      I’m glad it’s up and running. Let me know if anything else comes up.

  • http://www.cjwworld.07x.net/ Chris J

    Hello, its me again.. I updated the pluggin. But now it doesn’t work. I updated the config file as we done before. Made sure the TDP settings as well as the config and I come up with this error:

    Error: Cannot execute request: couldn’t connect to host

    any ideas. If I use the TDP setting page on my WordPress admin site. I have this shown on bottom of the page, that its uploading but then it stops.

    any help would be appreciated.


    Chris J

    • http://software.o-o.ro Andrew

      It seems I have some issues on mine as well when it comes to uploading. I’ll get to the bottom of this as soon as I can. Most likely later today. In the meantime please roll back to the previous version.

  • http://www.cjwworld.07x.net/ Chris J

    Okay.. Don’t stress over it.. just take your time..

    happy holidays

    chris j

  • http://www.yourappletrainer.com Chris P.

    Really excited about this Plugin. Thank you so much for making it.

    However, I’m having an issue that I haven’t found anyone else in this post having.

    This is error I get when trying to use the uploader with the destination field empty.

    Warning: mkdir() [function.mkdir]: No such file or directory in D:\home\grandslamstringers.com\wwwroot\wordpress\wp-content\plugins\dropbox-plugin\tdp_main.php on line 90
    Error: Cannot create temporary directory!

    I’ve tried putting in an existing directory and same thing. Any guidance would be greatly appreciated.


    • http://software.o-o.ro Andrew

      Hmm, in your “D:\home\grandslamstringers.com\ folder”, do you have a “tmp” folder? If so what are the permissions?

      If not, try making one and set the permissions to 755.

      Please let me know how it works out :D

  • http://www.yourappletrainer.com Chris P.

    Nope do not have a tmp folder anywhere. I created one however my FTP program would not let me change the permissions to 755.

    This is on a Windows based host. Does that even matter?

    I fiddle around and let you know how it goes. Thank you so much for the help.

  • http://www.yourappletrainer.com Chris P.

    Oh and the error I get is: ‘SITE CHMOD 755 tmp’ not understood.

    • http://software.o-o.ro Andrew

      Being a windows host shouldn’t make a difference, What exactly are you using to change the permissions?

      Both CPanel’s file manager and filezilla for example allow me to change it.