WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Admin can upload .flv videos, but the authors can't (4 posts)

  1. carbonated
    Member
    Posted 5 years ago #

    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!

  2. carbonated
    Member
    Posted 5 years ago #

    UP! Please help

  3. carbonated
    Member
    Posted 5 years ago #

    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

  4. plug_n_author
    Member
    Posted 4 years ago #

    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?!)

Topic Closed

This topic has been closed to new replies.

About this Topic