Wednesday, April 3, 2013

Tech Note: Unique Extension File Upload Fails In WordPress Multisite

OK I know the title of this article is a mouthful and technical. But I was trying to cover my bases in case someone like me is someday searching for this answer.

I had a problem yesterday that got me a bit confused, and so I thought I would post the solution here for anyone like me.

We are running a WordPress multisite install here at my work and that is actually what makes this problem a little confusing. Yesterday I had a user who was trying to upload some documents to make available to the public which has an unusual file extension. In WordPress multisite, there is an area in Network Admin Dashboard/Network Settings/Upload Settings where an administrator can set the file extensions that are allowed for upload. So I went there and added the file extension in question, but still could not upload the file. This is where multisite and standalone come together. Since it is a unique file extension that had not been established as a mime type for our WordPress install I needed to go into wp-includes/functions.php and add a mime type for the file extension in question. Just open the functions.php file and search for "accepted mime types", then add your file extension and it's mime type into the list.

With the mime type created and the extension added to the acceptable list under Network Settings you will be good to go.

2 comments: