Support » Fixing WordPress » Permitting SWF File Type

  • Resolved dcstorm2012

    (@dcstorm2012)


    Greetings all! I’m trying to upload a swf file and I’m getting the permission denied error. I have searched and found a thread that said to add this line of code to the end of my functions.php file –

    function demo($mimes) {
    	if ( function_exists( 'current_user_can' ) )
    		$unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
    	if ( !empty( $unfiltered ) ) {
    		$mimes['swf'] = 'application/x-shockwave-flash';
    	}
    	return $mimes;
    }
    add_filter('upload_mimes','demo');

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    However when I add it, it breaks my theme and everything goes blank. Help?

Viewing 8 replies - 1 through 8 (of 8 total)
  • What theme are you using? Where did you download it from?

    Thread Starter dcstorm2012

    (@dcstorm2012)

    I’m using the Catalyst theme that I purchased at YooThemes. http://www.yootheme.com/

    I’m sorry but as you are using a commercial theme, you need to seek support from the theme’s developer/vendor. We do not have access to, nor do we support, commercial products here.

    Thread Starter dcstorm2012

    (@dcstorm2012)

    No problem. Just wanted to make sure it wasn’t something easy that could be resolved without me having to ask them. I will do so. Thanks!

    Thread Starter dcstorm2012

    (@dcstorm2012)

    Back on this – just tried that line of code at a different website using the twenty-thirteen theme – broke that one too. Still get a blank screen.

    Am I adding it to the wrong spot in the functions.php?

    Sounds like you are creating the error yourself. Try checking your site’s error logs for a more specific error message. Your hosts should be able to help you accessing your site’s error logs.

    Thread Starter dcstorm2012

    (@dcstorm2012)

    Okay the error I’m getting is that this line is causing this fatal error: Fatal error: Call to undefined function add_filter() in ***/wp-includes/functions.php on line 4445

    add_filter('upload_mimes','demo');

    In my functions.php file the only thing after that line is –

    /**
     * Resets the mbstring internal encoding to a users previously set encoding.
     *
     * @see mbstring_binary_safe_encoding()
     *
     * @since 3.7.0
     */
    Thread Starter dcstorm2012

    (@dcstorm2012)

    Figured it out. Needed to drop the line of code inside of my themes function.php file, instead of the one in WP-includes.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Permitting SWF File Type’ is closed to new replies.