• Resolved jspicher

    (@jspicher)


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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jspicher

    (@jspicher)

    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

    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: https://core.trac.www.ads-software.com/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 – https://www.ads-software.com/extend/plugins/pjw-mime-config/

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Updated to 2.8.5 and having file upload troubles’ is closed to new replies.