0

When I try to upload a *.prc file type, I get this error:

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

How can I fix this?

2 Answers 2

1

This article explains a method in which you can add a file type to the list of allowed file types.

Copy and paste the following code into your functions.php:

add_filter('upload_mimes', 'custom_upload_mimes');
function custom_upload_mimes ( $existing_mimes=array() ) {
    // add your extension to the array
    $existing_mimes['prc'] = 'application/x-mobipocket-ebook';

    // add as many as you like
    // and return the new full result
    return $existing_mimes;
}

I didn't tested the code, but I hope it will help you along.

0

Add following code in your themes functions.php file. I have tested the code and its working fine.

// Add the filter
add_filter('upload_mimes', 'custom_upload_mimes');

function custom_upload_mimes ( $existing_mimes=array() ) {

    // Add file extension 'extension' with mime type 'mime/type'
    $existing_mimes['prc'] = 'application/x-mobipocket'; 

    // and return the new full result
    return $existing_mimes; 
}

For more information see this codex page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.