Aug 052013

I wanted to be able to upload photos from my RasPiCamcorder straight to DropBox. So I did a little research and came across an absolute gem of a program called Dropbox-Uploader, by Andrea Fabrizi.

A truly brilliant piece of work that gives you access to your DropBox account right from the command line.

You do have to jump through a couple of hoops to get it set up (security mostly), but once you’ve done that, it’s a breeze.

1. DropBox account

First of all you need a DropBox account. Hop on over to DropBox and get one – it’s free.

2. Download and Set Up DropBox Uploader

Next, you need to get Dropbox Uploader onto your Pi

cd ~ this ensures you are in /home/pi
git clone

(If this fails, you may need to install git with sudo apt-get install git-core)

You should be able to see a directory called Dropbox-Uploader

cd Dropbox-Uploader

You should now see three files, one of which is called This is the script we’re going to use.

DropBox-Uploader files

3. Now the fiddly bit – API keys

Run the script with ./ (if it fails, try chmod +x

You should see this…

Sorting out the DropBox API keys

You then need to visit this link, login to DropBox and create an “app” by clicking the “create app” button.

Then choose “Dropbox API app”, “Files and Datastores”, and answer the final question “Can your app be limited to its own, private folder?” – either answer is OK, depending on your needs.

Then you need to give your app a unique name, and you will be assigned some keys to go with the name. Now you need to type in those keys here…

Entering your app’s DropBox API keys

Once you’ve entered your keys and answered the question “app” or “full”, your Pi will request an authorisation token and you will be given a web URL you need to visit to activate it…

DropBox API authorisation

This is the part which annoyed me, as I was using a different computer to ssh into the Pi and couldn’t cut and paste the “rather tricky to type accurately” URL. But once you’ve got past that hurdle it should all just work. :)

If it works, you should see this in your browser…

Your DropBox account connected to your “app”

4. Now you can use DropBox Uploader on your Raspberry Pi…

…from the command line like this…

cd home/pi/Dropbox-Uploader
./ upload /home/pi/name_of_upload_file name_of_upload_file

This will upload the file you choose to your DropBox account.

…or use it in a Python script like this…

from subprocess import call
photofile = "/home/pi/Dropbox-Uploader/ upload /home/pi/photo00001.jpg photo00001.jpg" 
call ([photofile], shell=True)

And, if you look at the DropBox Uploader documentation, there’s a lot more commands you can make use of…

  • upload
  • download
  • delete
  • move
  • list
  • share
  • mkdir

I think this is brilliant. Yes you have to jump through a couple of hoops, but to be able to take a photo and see it on my PC, phone or Nexus 7 tablet within 30 seconds is pretty darned cool. I’ll jump through a couple of hoops for something that cool.

Here’s what it looks like in action, taking a photo and uploading to DropBox automatically. The DropBox upload photo part starts at 5m 7s.

  61 Responses to “How to use DropBox with Raspberry Pi”

  1. Now _that_ is a handy piece of software :-)

    • It’s brilliant isn’t it? What I love about it is that it’s basically a bash script using curl, so nothing much to install. You can call it from a Python script, and once you’ve done the initial setup it “just works”. :)

  2. You forgot to mention an easy way to manage/navigate dropbox with nice addon dropShell

    • LOL. I didn’t forget anything, I didn’t even know about it :p

      But I will delve into that further when I get the chance – it sounds interesting. Thanks for the tip. :)

  3. Hi Alex
    I got through the procedure, and got the message –

    Success! KCuploader2 is connected to your Dropbox.

    However, when I tried to upload a file called colours.jpg, it failed:

    pi@raspberrypi ~/Dropbox-Uploader $ ./ upload /home/pi/colours.jpg
    > Uploading “/home/pi/colours.jpg” to “/colours.jpg”… FAILED
    An error occurred requesting /upload
    pi@raspberrypi ~/Dropbox-Uploader $

    Can you see what I’m doing wrong?


    • Not unless it’s something silly like colours.jpg being in a directory other than /home/pi or internet connectivity?

      Try a different command? e.g. list.

      I haven’t played with this at all, but it would tell you if there was a general connectivity issue or a problem with the file you tried to upload.

    • Same problem. Did you resolve it?

    • Same problem here, too. Will try again with it at some point, though, as this could be really useful.

    • Did you guys give dropboax uploader access to your whole dropbox or just a specific directory? I gave it access to the whole lot. Just wondering if it makes a difference?

      • Worked perfectly second time around. Looks like I did list the wrong access level when setting up the Pi. I had to delete the Dropbox app, and unlink the Pi (./ unlink) before I could redo the Pi setup. Thanks for a really useful tutorial.

        • So which access level was the wrong one? And which was the right one? I’ve never tried anything other than full access.

          • I think first time around I told Dropbox to give the app access to the app folder only, and then mistakenly told Dropbox Uploader that it had full access. I’ve now got it working with full access, but I’ve no reason to think that folder access wouldn’t work.

          • Excellent – thanks :)

  4. This looks great to use just done the Dropbox app and installed the keys
    can you advise as I have never had the pi on the web direct what browser would you recommend. I do not use any desktop programs with it.


    • I did the web browser bit with my laptop (hence the comment about having to retype the tricky URL). But you can use Midori as a browser if you’re patient. (It’s not the Pi’s strength – frankly it’s too darned slow for me, but web browsing is not what it’s for IMHO – I have plenty of other devices that do that well.)

      • Thanks for quick reply despite being a very old noob well I cut my teeth on Nascom and ZX81. I had saved the web link but it has timed out so start again tomorrow.
        It is easy to copy paste from PI using Putty to a Vistal Laptop.
        It took me a time to find just highlight the pi text with left mouse click and hold drag to end of the text. Do nothing more in Putty
        Open the text edit program and do a ctrl v and the pi text is pasted to your program or browser address bar


        • Hi Terry,
          Join the club….ZX81 was my first intro to programming…1kb or a 16kb wobbly RAM pack! Is it me or was Z80 machine code a damn site easier than Linux???

          Anyway, just to add to your comments about copy/paste….
          Alex, as I assume you are copying the other way (ie copy from PC and paste to RPi) you select the text from your browser (or wherever) and CTRL C as usual then use PUTTY and just right-click. The text is pasted straight away. The other way, highlighting PUTTY text automatically copies it to the clipboard.


  5. Hi Alex,
    Your instructions are great! Unlike most things I’ve tried to do with the Pi, I went from reading your post to uploading a file to dropbox in about 5 minutes!!!

    Thanks again……now we just need a GUI method! ;-)


    • Thank you Dave. That would be mission accomplished then. Clear, precise instructions that work first time is what I strive for. I don’t do GUI on pi (yet).

  6. All worked first time today thanks a lot for you time and effort.
    PI to DropBox to Laptop takes 11 seconds .

  7. Cool. Works. Give it a try :) Thank You

  8. I tried it and it works perfectly. Thanks.

    I just have one question. By any chance, does anybody know a simple way to get (and use) the information given by the instruction “list” inside my python script ?

    I would like for exemple that my python script compare the content of a dropbox (remote) folder with a local folder. I have tried to google this issue but I did not find anything I could really use.

    I have to confess that I am still a newbie with both python and RPI (but oh boy, I have so much fun ;) )

  9. Thanks, great article

  10. I have been using Dropbox with my Rpi from the beginning, but via my linux workstation and the “sshfs” command.

    On the Rpi, I use “sshfs :Dropbox Dropbox”

    Then I use the Rpi Dropbox directory as normal.

    Works like a champ.

  11. Oh, oh!

    git clone

    Cloning into ‘Dropbox-Uploader’…
    error: The requested URL returned error: 503 while accessing https:/
    fatal: HTTP request failed

    pi@raspberrypi ~ $

    Problems in Andea’s directory?

    Help please.

  12. I got it working! Going to Andrea’s site took me through it. The above git clone command evidently didn’t like the …-Uploader.git at the end, wanted …-Uploader/ (no .git)

    Here is the link to her site: – good luck everybody – cool stuff!

  13. I seem to have linked it to the wrong a/f. Unlink didn’t seem to work for me. What’s the easiest way to uninstall the Dropbox-Uploader and start a fresh?

    Thank you, and very helpful. I had this working on another SD and it works seamlessly!

    • It’s just a bash script, so not really “installed” as such. I don’t know quite what it does with the keys and token though. The only foolproof way would be to flash a fresh SD card, but it’s probably really only a question of finding and deleting a couple of files.

      • Okay, no worries. I think it’ll be as quick to do a fresh SD ;)

        • All working. It was down to me using ‘f’ instead of ‘a’. Fresh SD did the job. I’m sure theres a quicker way, but for me it was quicker to just do a fresh install. This is part of an art exhibition in london at some point in spring next year. I’ll send some pics over to see your script on a big scale ;)

          Great work.

  14. Could I ask where the default configuration file is? I don’t see one in the location stored in the code – I have the default installation.
    Thanks for a great product,

    • I think you’d be best off contacting the author through his GitHub account :)

    • If I understand correctly what you’re looking for the file is .dropbox_uploader (with a dot at the front) in your home directory.
      Type ls -al for a listing including any config files.

      • Thanks Neil – I eventually emailed the author and he kindly put me on the right track. I use DU with a couple of piCams to look at the view from my windows when traveling – very nice. It’s also good for tracking your home IP remotely without use a DDNS – very handy.

  15. Hi, Thanks for the tutorial the upload to dropbox works only manually “./ upload /home/pi/ocr_pi.png”
    but if i run it with the attached Python script it shows some error on line 4

    Please help ..


  16. Hi, great tutorial.
    is there a script that takes the last created file and uploads it to Dropbox?
    not sure if i have missed something as your video does it but i can’t see any code to do this.

    this is what i have so far: -

    from subprocess import call
    import os
    import glob
    newest = max(glob.iglob(‘*.jpg’), key=os.path.getctime)

    photofile = “/home/pi/Dropbox-Uploader/ upload /home/pi/ newest”
    call ([photofile], shell=True)

    so as you can see i have just replaced the file name with the ‘newest’ object but it just sees it as a file name.


  17. To upload any file from command line try:
    write python app:

    from subprocess import call
    import sys
    TheCall = “/home/pi/Dropbox-Uploader/ upload ” + sys.argv[1] + ” /DropboxDestination”
    call ([TheCall], shell=True)

    The, from the command line do something like: python /home/pi/test.txt

  18. I can’t get the Uploader to work. I got through the tutorial OK, but could not see the .jpg on the Dropbox. I used:
    ./ upload /home/pi/name_of_upload_file with my .jpg file name. All I get is Uploader help file.
    I decided to re-install the Dropbox-Uploader again, removing the old directory. I can do the git command to download the file OK. But, now I can’t run even run this script:
    ./ I just get the help file again.

    • I found the trouble. If I use the Andrea script without the .git at the end, replaced by a forward slash, it works.

  19. Uploader wont work. Reinstalled Dropbox-uploader and getting help file. removed .git from:
    git clone
    to get: git clone and it still goes into help menu
    Any ideas?

    • I’ve just had a look at this myself – looks like the syntax of the script has changed slightly (maybe Alex could add a note to the article above) and the ‘upload’ option now requires a destination filename in Dropbox. I.e. instead of:
      ./ upload /home/pi/myfile.jpg
      you now need to do:
      ./ upload /home/pi/myfile.jpg myfile.jpg

      • Thanks for that. Will make changes in the text. I’m still using the old version on my RasPiCamcorder.

        • I following the steps as above, but when I run Run the script with ./ (if it fails, try chmod +x for the first time, I do not get the option of adding my app, I just get the help menu.

          Why is that?


          • Maybe is already linked to your account? Try
            rm ~/.dropbox_uploader
            and then try again?

  20. Yup, that worked, thank you.

  21. Hi all. Brilliant solution. Thanks for the excellent guides, Alex.

    I’ve a but I can’t crack. Dropbox-uploader works great when I call it from command line, but when I try to do so within a script, I am prompted to enter the app key as if I’ve not linked the app. For some reason if I initiate the shell script while not in the Dropbox-Uploader folder, I get the same result: requesting the app key. Even tried an os.chdir in the script to get around this, thusly:

    #!/usr/bin/env python

    import time
    import picamera
    from subprocess import call
    import os
    import glob

    newest = max(glob.iglob(‘*.jpg’), key=os.path.getctime)

    camera = picamera.PiCamera()
    photofile = “./ upload /home/pi/” + newest + “Code/Pi” #tried with and without specifying filename to place
    call([photofile], shell=True)

    Any help is greatly appreciated.

  22. I have a problem with the starting upload a file at boot. Could anyone help me?

Leave a Reply