Tag Archives: Dropbox

dropbox

New Dropbox API

In September, I posted about Pressbox, an awesome WordPress plugin that intuitively lets you link to documents and images in your Dropbox account. If you’ve downloaded this plugin or pretty much any other similar plugin in the past week or so, you may have noticed it doesn’t work. It’s not the plugin’s fault, though. Dropbox released a new API on October 21st. According to this post, the previous version “still works exactly as it did before”. This is true if you have an application that had already been authorized with a token – all WordPress Dropbox plugins require you to create your own “app” under your Dropbox account.

The new API adds some pretty significant new functionality, though. It’s more secure, and it allows you to have an app-specific folder instead of just giving it full access to your whole Dropbox, though you can still do that too. You can stream media straight from your dropbox account, which is pretty huge in and of itself. You can search for files in your dropbox account, create shareable links to files, and you can manage file revision history, which makes using Dropbox for collaboration a lot more effective.

wordpress-dropbox-logos

Using Dropbox in WordPress

Dropbox is one of the many cloud-based file storage services out there, and it’s also one of the most seamless. You can sign up for a free account for up to 2GB of storage. If you need more storage space, the larger plans are fairly reasonable. There’s a desktop application that adds a folder on your computer which is synchronized with your Dropbox account in real time. They also have Android and iPhone apps that do the same thing, so you can download and update your documents on the go.

The ability to collaborate is probably one of the more interesting features – you can share a folder with other Dropbox users and they can update the files in that folder as well. I have a client that wanted the ability to display links to a set of documents which would be updated by a small group of people on a regular basis on her WordPress site, but didn’t want them to have to log into the site and update the file every time the file was updated. There are only a few Dropbox Plugins for WordPress out there, and really only one that serves this purpose well.

Enter PressBox – this adds a tab to your Media Upload screen and allows you to display images or link to any files in your Dropbox account anywhere on your WordPress site in a very convenient and intuitive way. The plugin also uses OAuth so your Dropbox account details are not stored for the plugin to gain access.

After selecting your document and inserting it into the post, you end up with something like this:

[[pressbox path=/test.docxtype=link]]

Notice how the path and the “type” attribute run together. Another bug is that when you click the download link, your browser recognizes the correct file type and you do download the correct file, but it ends up being named “pressbox.php”. These are a couple bugs which I have contacted the plugin developer about as well as correcting in the download below.

Under the current release, it defaults to making the link text the filename like so: There’s not a place for it in the Media Upload window, but you can add a “name” attribute to the shortcode to override the link text like so:
[pressbox path=/test.docx type=link name="Test Document"]
which gives you this:

[pressbox path=/test.docx type=link name="Test Document" ]

I found it rather interesting that in the Media Upload screen, it detected the file type and displayed a file type icon, but there’s no option to display the filetype icon with the link, so I updated the plugin to do this as well. Now, the Media Upload screen will also include the URL to the appropriate file type icon in the shortcode, and it will be displayed like so:

[pressbox path=/test.docx name="Test Document" type=link iconimg='http://www.bryanheadrick.com/wp-content/plugins/pressbox/images/page_white_word.gif']

Download: PressBox by Les Harris (74)