Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorry, this file type is not allowed for safety reasons. #27

Open
popropusku opened this issue Feb 23, 2017 · 3 comments
Open

Sorry, this file type is not allowed for safety reasons. #27

popropusku opened this issue Feb 23, 2017 · 3 comments
Assignees

Comments

@popropusku
Copy link

Hey. When you import an error occurs.
What could it be?
=== Sorry, this file type is not allowed for safety reasons. ===
23-02-2017 22-12-51

@kevinlangleyjr
Copy link
Member

kevinlangleyjr commented Feb 25, 2017

Is your WordPress setup a multisite?

If so, the allowed upload file types needs to be adjusted to add the json extension as well.

Located within, Dashboard >> Network Admin >> Settings >> Network Settings

https://cloudup.com/cINp_KChN-R

@kevinlangleyjr kevinlangleyjr self-assigned this Feb 25, 2017
@kelicia
Copy link

kelicia commented Dec 28, 2018

I added json to the network site settings but am still seeing the message. Any other suggested fixes?

@jcamp
Copy link

jcamp commented Apr 7, 2020

This does work.

Add define(‘ALLOW_UNFILTERED_UPLOADS’, true);
to your wp-config.php
but, there is a problem in the latest wordpress that requires super-admin privs for it to work.

There’s probably a db entry for file types allowed anyway (well it should to be compatible with standard coding practices) but if you want a quick fix, backup the file *capabilities.php (in the wp-includes directory) and make these changes if you want it to work and are only logged in as admin.

find the unfilter_upload section and change to:

case ‘unfiltered_upload’:
if ( defined(‘ALLOW_UNFILTERED_UPLOADS’) && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin( $user_id ) ) )
$caps[] = $cap;
else
/* temporary removed this for work around
$caps[] = ‘do_not_allow’;
and changed to this after comments
*/
$caps[] = $cap;
break;

the wp_config.php change mentioned previously will work after that.

!!Just back up the files first incase you make a mistake!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants