Nerds at Work

RSS

Modify WordPress to Accept New Filetypes as Uploads

Written by Brian on September 3, 2010 – 7:39 pm -

Ran into a new problem with WordPress today. I was working on my photography blog, and I wanted to upload a DNG file (a standardized RAW format) so that people could work along and edit the photo with the Lightroom tutorial. When I tried to upload the photo, I got the unsettling response: “File type does not meet security guidelines. Try another.”

Now I can understand if this was a WordPress.com blog and they had restricted certain filetypes (or another shared host). But this was my blog, gosh darnedit, and I was gonna upload that file if I wanted to…!

A quick search revealed just the type of WordPress hack that I needed. Read the full explanation of how to modify the allowed upload types in WordPress on Chris Meller’s blog. The gist of the solution is that WordPress uses a function, “upload_mimes” to check what file types are allowed. You can add a filter to hijack that function, add your own filetype, and pass that back to WordPress.

I followed Chris’ directions, added ‘dng’ to the array, and it worked like a charm. Awesome.

Posted in CMS Tricks, Nerds at Work | No Comments »
Tags:

Can’t Create Thumbnails in Nextgen Gallery WordPress Plugin

August 15, 2010 – 9:57 am

Ran into some weird trouble with the Nextgen Gallery Wordpress plugin. Couldn't find a lot ...

No Comments »

How to Make Shortcodes Work in WordPress with the Excerpt

August 12, 2010 – 6:06 pm

I'm working on a new theme for another project (Olinda Gibbons Photography), and I ran ...

7 Comments »

How to Hide the Navbar on a Blogger Hosted Blog

January 4, 2009 – 4:11 pm

So you haven't made the jump yet from a Blogger blog to a self-hosted one. ...

1 Comment »

Backup Your WordPress Database. Often.

December 19, 2008 – 10:09 am

You've spent countless hours over the past year building up your blog. Adding content, getting ...

1 Comment »

Grr… Feedburner.

December 13, 2008 – 9:32 pm

Last week, I wrote a quick post about redirecting all my Wordpress feeds to Feedburner. ...

No Comments »

Redirecting WordPress Feeds to Feedburner

December 6, 2008 – 7:30 pm

Continuing my attempts to improve this site, I decided to embark on creating feedburner feeds ...

11 Comments »

An Argument for Single Spaces After Periods

November 22, 2008 – 12:45 pm

Some time ago, I remember reading an argument over whether you should include one or ...

2 Comments »

301 Redirect for Posts in WordPress and CMSMS

November 11, 2008 – 1:40 pm

Although this site is new, I'm slowly incorporating a series of old, defunct projects into ...

No Comments »

Google Analytics: Inserting Into a WordPress Template

March 29, 2008 – 7:08 pm

Google Analytics is a great tool for gathering data about your website. You can ...

No Comments »