WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Admin can upload .flv videos, but the authors can’t

[Resolved] Admin can upload .flv videos, but the authors can’t

  • Hi! Sorry if I post in the wrong category.
    I have one problem with the upload:
    -when the admin upload .flv file it uploads, but
    -when author upload .flv file it says “Unrecognized file type.”
    How can I fix this problem? Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • UP! Please help

    I fixed it myself – open functions.php from includes folder and fint the formats of the files. Add there this code 'flv' => 'video/x-flv', and you are ready to upload!
    RESOLVED

    For those looking for a cleaner solution that is free of upgrade issues, drop this into your plugin directory and activate it:

    <?php
    /*
    Plugin Name: FLV Hack
    Plugin URI: http://www.someplace.com/
    Description: Quickie FLV hack/fix.
    Version: 1.0
    Author: Someone
    Author URI: http://www.someplace.com/
    */

    add_filter(“ext2type”, “FLV_Hack_ext2type”, 10, 1);
    add_filter(“upload_mimes”, “FLV_Hack_upload_mimes”, 10, 1);

    function FLV_Hack_ext2type($filters)
    {
    $filters[“video”][] = “flv”;

    return $filters;
    }

    function FLV_Hack_upload_mimes($mimes)
    {
    $mimes[“flv”] = “video/x-flv”;

    return $mimes;
    }
    ?>

    This does the exact same thing as editing functions.php to add FLV but without requiring you to apply the same mod to the WordPress core – plus it shouldn’t break even if WP includes this in the future. (The question becomes: Why isn’t FLV already in WP?!)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Admin can upload .flv videos, but the authors can’t’ is closed to new replies.