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.
Related Posts:
- Can’t upload media, permissions are correct
- Media not actually deleted on disk when click “Permanent Delete”
- What permissions does wp-content/uploads need?
- WordPress monthly upload directory owner set to root
- Moving Media Library
- Maximum upload size changes in php.ini ignored – How to remove upload size limit?
- What error logs can I check to see why plugin updates are failing?
- Copying uploaded images not working in wordpress
- The uploaded file exceeds the upload_max_filesize directive in php.ini
- Hide images from anonymous user?
- Saving file to disk receiving fopen error
- User permissions to upload images
- wordpress upload permission on nginx & ubuntu
- How do I force WP to set upload directory permissions correctly?
- Unable to upload anything to WordPress site
- I migrated WPMU site: Unable to create directory uploads/… Desperate for help!
- Used Duplicator to transfer a site. Now my media uploads aren’t working
- Problem uploading files, after changing domain name
- Basic File/Post restriction plugin
- Cannot upload themes. Error: “The uploaded file could not be moved to /var/www/wp-uploads/localhost/2011/10.”
- How to show all available images in WP’s media library when using the Polylang plugin?
- Saving Media – Which Hook is Fired?
- retrieve custom image sizes from media uploader javascript object
- Is it possible to allow zip files to be uploaded in WordPress?
- Set a maximum upload count for users on a specific user role
- Append button to WordPress Image Details modal
- Importing WordPress Attachments Into Custom Directories In wp-content/uploads/
- add_image_size creating lots of images (of various sizes)
- This file type is not allowed. Please try another
- File Upload Permissions
- Setting the uploads directory
- Retrieving JSON data in ajax request from media uploader
- How to disable WordPress Media resize different size version?
- insert post & Upload post thumbnail from the front end using ajax
- how can i simple change upload folders to %year%/%month%/%day%?
- How to side load an image from a service
- Regenerate thumbnails unexpected resolution (96 x 96)
- Change default uploads file using wp Skeleton
- Change default from “Attachment post URL” to “File URL” in Add Media
- how to use media library [closed]
- Adding Adobe files to a wordpress site [closed]
- Unable to Upload Images on Local Windows Install
- What types of files can I upload with the WordPress Uploader?
- Replacing Images in Media Library
- Creating a feature to upload multiples images in the Theme Options?
- Disabling direct access to images using .htaccess
- Restrict WordPress Media Library for a specific user role (users can only see/select own media)
- Manual filename while uploading attachments
- Make WordPress compress full size image?
- Move files from flat upload directory to organised by year / month
- Can’t manipulate media uploads
- How to limit the number of simultaneous media uploads?
- Custom media uploader not showing library
- Symbolic link for uploads in wordpress
- Upload iPhone video clips to blog via native WP app
- Process uploads with phpThumb before generating thumbnails
- Resize existing library images
- WP 4.3.1 new install on localhost missing php.ini [closed]
- Large image upload size (using timthumb.php
- How can I manage and limit disk usage for each author?
- How would I change the 10 MB limit to 5 GB in this script?
- Media Library Won’t Display Any Images
- When does WP resize an image file
- How can I modify the media upload form fields?
- More Fields & Media Upload
- Upload Custom Mime Types in WordPress (SVG, WebP)
- “Sorry, this file type is not permitted for security reasons.”
- upload_max_size doesn’t change
- Upload and attach to a post multiple image files [closed]
- Changing titles in Uploader for “Posts”
- WordPress upload file action hook
- Batch upload to create posts each with one image, headline, and body text
- Control resizing of uploaded images
- Upload PDF and other files from the Front-End
- Custom Text in Media Uploader in a Theme Options Page
- How to disable image thumbnails from media manager but not post media uploader?
- Do custom post type (CPT) attachments/media store the parent post ID?
- Get uploaded video URL
- How Do I Change the File Permission For Uploaded Files in WordPress?
- image not display in media library and thumbnail not display in post
- Using unzip_file() to get contents of file
- Moving wp-content folder to public_html
- An error occurred in the upload. Please try again later
- Using Gravity Forms to upload media into library, then attach to post
- Why I am not able to upload media files?
- Featured image to grayscale with PHP imagefilter – which hook to use?
- Store uploads on an external server?
- Force relative path in media library for LAN deployment
- Make thumbnail from uploaded image without plugin
- Making Site A Use Site B’s wp-content Folder
- Limit number of uploaded attachments of specific context
- Set featured link not showing
- WordPress upload folder on separate server
- increase maximum upload file
- How i can upload images to another folder?
- make default upload folder year/month/day wordpress without plugin [duplicate]
- Display Image Upload from Contact Form 7 on Redirect Page [closed]
- media_handle_sideload() fails
- Auto shortlink for file uploads
- Obtaining detailed error information from Media file upload process