Uploading Uncommon File Types to Wordpress

While putting together my last post, I was confronted with a bunch of error messages when trying to upload the VSIX file to my blog.  The overall process to fixing it turned into an ordeal which I figured I would document in case others run into the problem.

The first sign of troubles was when uploading the files from Windows Live Writer (which, IMHO, is a pretty good tool for writing blog posts).  When uploading my draft, I received an error dialog similar to the following:

metablog_unknownFiletype

After looking into this (on a previous occasion), I learned that this error means it was trying to upload a file type that wasn’t supported on the blog.  The errors about supporting picture publishing is a big fat red herring; uploading images works just fine.  Apparently WLW doesn’t distinguish between images and other file types.

After a little magic with Bing, I found out how to configure Wordpress to allow new and interesting file types in uploads, simply by adding to the item filter in my theme’s functions.php.  I probably could have put it into the root functions.php, but the directions said to use the theme.  Hopefully I remember this if I ever change themes again.

Thinking I had conquered the beast, I tried uploading again.  This time I was faced with the following error:

The response to the metaWeblog.newMediaObject method received from the blog server was invalid:

Invalid response document returned from XmlRpc server

Some more Bing magic revealed that several people have run into this, and many of them resorted to undoing their last configuration change.  That wasn’t an option if I wanted this to work, but fortunately I stumbled across this link, which gave me the idea of crafting a new php.ini file.  Being on a hosted account, I put a new one together and just uploaded it into the root directory for my hosting account.  So far, so good.

With all this mess in place, I was able to upload my files without issue.  But of course, the adventure couldn’t end yet!  I went to test my blog post to make sure it would download correctly, and ended up with a 404.  This turned out to be due to the MIME type not being registered for the file.  As my site is hosted on IIS, I turned to this blog post (by coincidence, the author is currently my lead’s manager’s manager’s manager; small world) on how to register MIME types via web.config.

And with that, my issues were resolved… at least, from the hosting perspective.  There were several seemingly unrelated steps involved, but hopefully my pain will help someone else in the future.

Leave a Reply