Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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