The MU forums have moved to

Uploading Publisher Files (7 posts)

  1. tvictory
    Posted 16 years ago #

    Any ideas why I am not able to upload files with an extension of pub? I have teachers who want to upload publisher files and it is not allowing them?

    The error message is that they file type does not meet the security requiremnts.

    I went into the admin panel and told it to allow the uploading of pub files. I was able to get it to allow uploading of other files this way, such a doc and xls files.

  2. ekusteve
    Posted 16 years ago #

    I ran into this problem a few weeks ago with office 2007 files. What I discovered just through trial and error was that I needed to add these file extensions in wp-includes/functions.php

    Here is what I did to make this work on my site.

    1. Open wp-includes/functions.php
    2. Find "function wp_check_filetype" around line will see a long list of file types under this function.
    3. If you want to be able to upload a file type that is not there (like publisher files or Office 2007 files), then you need to add them in the list.

    To add word, powerpoint, and excel 2007 just add those extensions in the appropriate places like so...

    For word change from:

    'doc' => 'application/msword',


    'doc|docx' => 'application/msword',

    You are just adding the 2007 extensions to the office types already there. So, add pptx and xlsx to the PowerPoint and Excel lines.

    Since Publisher isn't there, you will need to add a new line for Publisher like this.

    'pub' => 'application/mspublisher',

    Save the file and then log in as site admin, go to your options tab and enter these extensions and they should work.


    Disclaimer: This works on my site and I haven't seen any negative effects, but use at your own warranties expressed or implied :-)

  3. tvictory
    Posted 16 years ago #

    I will try this as soon as I get to work tomorrow. I appreciate your help and the quick response.

    I will let you know how it works.

  4. tvictory
    Posted 16 years ago #

    Worked like a charm! Thanks for the help

  5. shacker
    Posted 16 years ago #

    It does work like a charm, but unfortunately means that the "Upload file types" field in Admin/Options does not work at all. It lets you add allowed filetypes, but then completely ignores whatever you've put there. You still have to hack core to modify allowed filetypes :(

    It's as if someone started work on the filetypes feature in Admin but then never tested it before the current version of WP-MU shipped.

  6. andrea_r
    Posted 16 years ago #

    I'm not on a windows box, so i can't test publisher files specifically, but if a couple more people confirm this with some details, I'd be more than happy to file a trac ticket.

  7. shacker
    Posted 16 years ago #

    To clarify - I'm on an OS X server and was trying to allow upload of aac and m4a audio files. Adding these to the field in Admin/Options made no difference; I had to also add them to wp-includes/functions.php to get it working. Thanks for looking into it!

About this Topic

  • Started 16 years ago by tvictory
  • Latest reply from shacker