Dropbox is one of the best tools when it comes to backing up files or syncing them between multiple computers or mobile devices. I regularly use Dropbox to store important backups, sync my Firefox bookmarks and do a lot more.
One of the limitation of Dropbox is that it does not allow other users to upload files to your Dropbox account. Suppose you want your friends or blog visitors to upload images and other documents to a folder in your Dropbox account. In that case, can they upload the files without knowing your Dropbox account’s username and password. No they can’t !
As a workaround, you can create this simple browser uploader for Dropbox which will allow anyone to upload files to a particular folder in your Dropbox account. All you need is a web server that supports php.
To see the Dropbox uploader in action, please visit this project page and use the simple browser based uploader to upload a file from your computer. Then click “Upload” and the file will be sent to my Dropbox account.
Download: You can download the entire source code and the follow these instructions to set the uploader working with your own Dropbox account.
How to Allow Anyone Upload Files to Your Dropbox account
1. Log in to your Dropbox account and create a new folder for storing the files uploaded by other users or that of your friends.
2. Extract the package and you will get two files – index.php and DropBoxUploader.php. Open index.php in any HTML editor.
3. Go to line 48 and enter your Dropbox account username and password, as shown in the following image:
Note: Since the code is written in PHP, your username or password wont be visible in the page’s source code. There is nothing to worry !
4. Go to line 71 and enter the name of the folder which you created in step 1.
5. Create a new directory anywhere in your website and upload both the files ( index.php and Dropboxuploader.php) in that directory.
You are done !
Now pass the address of our Dropbox uploader page to your friends or to anyone whom you want to upload files. The browser uploader works with all types of file formats e.g text file, images, Zip and RAR formats, mp3, videos, word documents and so on.
Watch the Screencast
Here is a quick screencast which shows how the Dropbox uploader works. First I will upload the source files to a folder in my website and then use the browser uploader to upload a simple text document to my Dropbox account.
You may also like to read our earlier tip on how to use Dropbox to host a static website for free. If you have multiple Dropbox accounts learn how you can run multiple instances of Dropbox on Windows.
Thanks to Jaka Jancar for the hat tip.
Update: Added password protection
Some users suggested that it would be nice idea to add a password field so that spammers can’t upload files to your Dropbox account. I have added support for password protecting file uploads, download the new script and follow these instructions:
1. Open Index.php in an HTML editor
2. Go to line 27 and enter a password. This need not be same with your Dropbox account’s password.
3. Go to line 52 and enter your Dropbox account credentials.
4. Go to line 75 and enter the name of the Dropbox folder in value field
5. Upload all files in a directory of your web server.
6. Done !
Now pass the address of the page and the password to your friends and let them upload files to your Dropbox account.
I am trying to add multiple file uploads in the script. Will update this post if I am successful.