"Sorry, this file type is not permitted for security reasons.”

I'm developing on a localhost on a Mac (AMPPS for Mac).

When I attempt to upload a JPG exported from Photoshop, I receive the error “Sorry, this file type is not permitted for security reasons.”

I have debug turned on with no errors produced.

If I migrate the database to a remote staging server using WP Migrate DB Pro, I receive the same error on the remote staging server.

I have added the constant define('ALLOW_UNFILTERED_UPLOADS', true); in wp-config.php and the issue remains.

I have added the following to my theme functions.php with no change:

function enable_extended_upload ( $mime_types =array() ) {
    $mime_types['jpg']  = 'image/jpeg';
    return $mime_types;
}
add_filter('upload_mimes', 'enable_extended_upload');

Changing to Twenty Seventeen does not resolve the issue.

If I deactivate all plugins the issue remains.

Reinstalling Wordpress does not resolve the issue.

How do I troubleshoot this please?

Thanks, Steve

Topic mac uploads errors Wordpress

Category Web


Because the problem was not host, theme, or plugin specific, I figured it must be an issue in the database.

On the remote staging site, I dropped all database tables, reran the Wordpress setup wizard, enabled plugins, and then imported a Wordpress export from the local development site.

I can now upload images, but still don't know what was preventing me from uploading them originally.

Edit: I can upload some images. The original Photoshop saved/exported JPGs still produce the same error.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.