WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Updated to 2.8.5 and having file upload troubles (4 posts)

  1. jspicher
    Member
    Posted 4 years ago #

    Hi folks,

    today l upgraded to 2.8.5 and when l try to upload a *.php file l get an error that reads: "File type does not meet security guidelines. Try another."

    I understand the restriction and why it's there; but l know what l'm doing and my uploads directory is protected. On the blog that this is running on l have php scripts that are uploaded and shared and l need to be able to upload *.php files ... l looked for the settings but couldn't find anything. Can you guys tell me how l can enable *.php file uploads again on my WP installation?

    Thanks!!

  2. jspicher
    Member
    Posted 4 years ago #

    UPDATE:

    Well since l haven't had a response l did some digging and found a patch for this by modifying the following line in ../includes/functions.php

    Find on line #2245:
    <strong>'htm|html' => 'text/html',</strong>

    Replace with:
    <strong>'htm|html|php' => 'text/html',</strong>

    Of course every time you update you'll need to make this tweak, but l need to be able to upload PHP files to my media directory ... period.
    I have also added the following to my ../wp-content/uploads/ directory to prevent php files from being run as PHP files.

    I created an .htaccess file in the root of my ../wp-content/uploads directory and placed the following in it:
    AddHandler text/plain .html .htm .php .php3

  3. This is due to the change in WordPress 2.8.5 where all uploads are now subject to the extension white list even for admin.

    You can read more about the change here: http://core.trac.wordpress.org/ticket/10692

    You have a number of options for a permanent fix without hacking core files:

    1. You can re-enabled the admins ability to upload whatever then want by adding define(’ALLOW_UNFILTERED_UPLOADS’, true); to your wp-config.php file
    2. You can manage the list of available file types using this plugin - http://wordpress.org/extend/plugins/pjw-mime-config/
  4. jinglecat
    Member
    Posted 4 years ago #

    I have the same problem. Luckily, westi shared his solution. Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic