WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can't upload swf files to wordpress anymore. (15 posts)

  1. chrisntoukas
    Member
    Posted 10 months ago #

    Hello.

    I have WordPress version 3.6.1 and i cant upload any swf files because of this message ' Sorry, this file type is not permitted for security reasons.'

    Can anyone help me ?
    Thanks in advance.

  2. WPyogi
    Volunteer Moderator
    Posted 10 months ago #

  3. chrisntoukas
    Member
    Posted 10 months ago #

    Thanks for your answer.
    I did that but now i cant upload any kind of images files on my site.

  4. Scriptrunner (Doug Sparling)
    Member
    Posted 10 months ago #

    The sample code in the previous post is incorrect. It replaces all other mime types with only swf and exe. It needs to add the missing types to the existing allowed mime types:

    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');

    I left out "exe" because that wasn't asked for and I wouldn't allow it normally. If you want that as well, just add this line:

    $mimes['exe'] = 'application/x-msdownload';
  5. chrisntoukas
    Member
    Posted 10 months ago #

    That worked perfectly. Now i can upload swf files and any kind of images.
    Thanks a lot, i appreciate that.

  6. Scriptrunner (Doug Sparling)
    Member
    Posted 10 months ago #

    chrisntoukas, you're quite welcome! If you don't mind, please mark the topic as resolved to help others who may have run across the same incorrect code in the other post.

  7. soldier33
    Member
    Posted 9 months ago #

    I used this to upload swf files to my website as well:

    http://jumpstartdesigner.com

    However, once I have it uploaded I am having trouble embedding it into a project at a specific size. I have tried multiple plug-ins but most don't work in any browser. Top Flash Embed was the only one I found that was compatable with 3.6.1 but development has stopped and I'm having sizing and cross platform issues with it.

    Maybe there is a plug-in someone can suggest or some code perhaps?

    Thanks in advance!

  8. Scriptrunner (Doug Sparling)
    Member
    Posted 9 months ago #

    Since this particular topic is resolved, and the question you have is actually quite different from the original topic, please post a new topic for your question. Thanks!

  9. zeus909
    Member
    Posted 9 months ago #

    Hey guys i am a newbie here..so can you tell me where is this code to replace???

  10. chrisntoukas
    Member
    Posted 9 months ago #

    Hey mate.

    Just copy the code Scriptrunner wrote above and place it in the last line of functions.php above the php closure.

    the code goes here.
    }
    ?>

    Save your functions.php before make any changes on it.

  11. hamizul
    Member
    Posted 7 months ago #

    Hey Chrisntoukas and friends, I try to search the last line of function.php from the editor that ending with :

    }
    ?>

    but still i couldnt find it.
    For your information,i'm using twentytwelve theme.

    Could you or any other friend help me to solve this problem

  12. Scriptrunner (Doug Sparling)
    Member
    Posted 7 months ago #

    Common php best practice is to not include the closing "?>" php tag if it's the last line in the file. Just put the code above at the bottom of functions.php. (actually, it can go anywhere in the file.)

  13. WPyogi
    Volunteer Moderator
    Posted 7 months ago #

    @hamizul - if you need further help, please stick to your own thread - posting in more than one place makes it much harder for people here to help you -

    http://wordpress.org/support/topic/how-to-upload-swf-file-without-using-plugin?replies=7

  14. Asmond5
    Member
    Posted 7 months ago #

    I am using elegant theme Lumin. I have tried adding this code to the functions php but it ignores the code. Is there a different place I need to add it?

  15. Andrew
    Forum Moderator
    Posted 7 months ago #

    Try Elegant Themes' support forum: https://www.elegantthemes.com/forum/

Reply

You must log in to post.

About this Topic

Tags

No tags yet.