The MU forums have moved to WordPress.org

Where Are Allowed File Types Settings Kept? (20 posts)

  1. suleiman
    Member
    Posted 17 years ago #

    I needed to know in which file specificaly. The problem I'm having is the options under Site Admin aren't saving.

  2. Bruz
    Member
    Posted 17 years ago #

    They are kept in the DB - wp_sitemeta / upload_filetypes

  3. suleiman
    Member
    Posted 17 years ago #

    Wow...well then in that case I now have no idea what's going on. In both my Site Admin Options page, and my wp_sitemeta / upload_filetypes table "flv" filetype is listed.

    Yet despite every attempt to upload it I get the same error from wordpress telling me the file type is not allowed.

    Anyone have any clue as to why this might be happening?

    I've got max file size set to 30 megs and only trying to up a 5 meg file!

    FYI the error I get is: "File type does not meet security guidelines. Try another."

  4. Ovidiu
    Member
    Posted 17 years ago #

    edit blog.php and add this line udner the other allowed lines:


    'fli' => 'video/fli'

    I am sorry but I can't find the mime type for flv take this as an example.

  5. suleiman
    Member
    Posted 17 years ago #

    the mime type for flv is as follows:

    'flv' => 'video/x-flv',

    unfortunately this produces no results either.

  6. suleiman
    Member
    Posted 17 years ago #

    Okay, this is how I fixed my problem:

    Went to http://blog.ftwr.co.uk/archives/2006/09/03/pjw-mime-config-v090-released/

    And downloaded that man's plugin for adding more mime types to wordpress. It comes bundled with the the additional mime types needed to play flv files.

    The plugin works in the mu-plugins folder, but I had to hack it a little bit to keep the Options page from displaying for non-site admins.

    At line 50 change:

    function admin_menu()
    {
    add_options_page('Mime types','Mime

    To:
    function admin_menu()
    {
    get_currentuserinfo();
    if( is_site_admin() )
    add_options_page('Mime types','Mime

  7. darrenterhune
    Member
    Posted 17 years ago #

    If you don't want to bother with plugins, (which is the way to go), you can read my article about this fix. It's actually really easy to do and you don't need advanced php skills to do this. goto -> http://headfirstproductions.ca/wordpress-file-type-upload-error-security-fix/

  8. drmike
    Member
    Posted 17 years ago #

    *chuckle* the link 404s. I don't see it elsewhere on your home page so I can't fix the link.

  9. darrenterhune
    Member
    Posted 17 years ago #

    Sorry I've updated some things last night. Here it is: http://headfirstproductions.ca/blog/wordpress-file-type-upload-error-security-fix/

  10. drmike
    Member
    Posted 17 years ago #

    That's for regular wordpress. May not work for WPMu.

    I know that there's some code for this as well within (I'm doing this from memory) wp-content/blogs.php or index.php

  11. darrenterhune
    Member
    Posted 17 years ago #

    I don't see anything within the index.php? I guess it's impossible for WPMu's to edit any of there pages? I've never used it before.

  12. drmike
    Member
    Posted 17 years ago #

    Actually it's in wp-content/blogs.php. I could do a search when I typed that.

    Those filetypes are in there though so I guess it wouldn't be an issue.

  13. suleiman
    Member
    Posted 17 years ago #

    i came to the above solution after having tried to edit both blogs.php and the options for uploadable file types. I'd strongly encourage using a plugin than hacking away at core files.

  14. drmike
    Member
    Posted 17 years ago #

    But we like hacking away at core files. :)

  15. zylstra
    Member
    Posted 17 years ago #

    suleiman, your suggestion did not work for me. I see the options, and have added a file type, but I still cannot upload the additional file types.

    I can't even upload zip files. I can however upload gif's and pdf's.

  16. FifthE1ement
    Member
    Posted 17 years ago #

    I think what everyone is asking is how can we set this up so that only the admin can control the types and so that the users cannot see them. I am having the problem in which the plugin works (pjw-mime-config-v090) but the users first have to enable it (or i can put it into the mu-plugins) and then have to add the file types before they can upload. It seems to be on a user by user basis and I want to make the changes global. Can anyone modify the code so that only the admin can make changes and globally effect everyone?

  17. FifthE1ement
    Member
    Posted 17 years ago #

    Anyone?

  18. drmike
    Member
    Posted 17 years ago #

    I'd just remove that portion of the code that gives them the option and hard code in the allowable file types.

  19. ryanozawa
    Member
    Posted 17 years ago #

    suleiman, does your hack of the plugin solve the 'admin' versus 'user' view problem FifthE1ement mentions? Is it still per-user or is one set of allowed file-types universal? Anyone hacking something more WPMU specific?

  20. carnold
    Member
    Posted 16 years ago #

    Using 1.3.3 and in my wp-includes/functions.php is 'doc' => 'application/msword', but i still can not upload doc files. I have tried as a user and admin. Shouldn't i be able to upload the file types listed in functions.php?

About this Topic

  • Started 17 years ago by suleiman
  • Latest reply from carnold