Allowing file types outside of WP’s defaults exposes your site to some security risks, and some hosts don’t allow certain filetypes. If your host allows these filetypes, you can use the following function in a plugin or a child theme:
function wpse_file_uploads($mime_types){
// photoshop
$mime_types['psd'] = 'image/vnd.adobe.photoshop';
// illustrator
$mime_types['ai'] = 'application/postscript';
// indesign
$mime_types['indd'] = 'application/x-indesign';
return $mime_types;
}
add_filter('upload_mimes', 'wpse_file_uploads', 1, 1);
Probably best to put this in a custom plugin because if you or another user switch themes later, you won’t want to lose this functionality.
Related Posts:
- Setting wp_temp_dir and permissions not working for “Missing A Temporary Folder” error
- wp_temp_dir does not change the /tmp temporary default directory
- Can’t write pdf file to upload directory using FPDF
- Change default uploads file using wp Skeleton
- Placing assets for external use
- WordPress HTTP Error on File upload
- Interface for logged-in users to upload/download files
- Right way to download file from source to destination
- Uploaded images result in a file url with full path on disk appended
- Where to store sensitive uploaded file?
- Creating an .ics calendar subscription service with wordpress
- Private file system for attachments
- How does WP media uploader create the 3 different sized images, and how can I duplicate it
- Create image formats with different qualities when uploading
- Which filters or actions to use after a media upload and delete?
- wp_delete_attachment doesn’t delete images in wp-content/uploads/
- Force WordPress 3.3 to use Flash uploader
- Protecting direct access to PDF and ZIP unless user logged in (without plugin)
- How to add more upload directories?
- Multisite, upload images directly to Amazon S3
- How can I speed up a slow loading media library?
- What to do with unattached logos and header uploaded via native wordpress uploader?
- upload_mimes filter has no effect
- Impose a Maximum Limit on Image height and width upload size
- Force wordpress to see uploads folder media
- Moving Media Library
- Add item to media library from blob or dataUrl
- How do I enable the customize theme page to accept svg’s?
- Frontend Simple Local Avatar upload
- Disable TinyMCE Drag and Drop
- WP3.5 Media Uploader – how to make it accept multiple images?
- How to define a remote uploads directory?
- Looks like image resize is not working well
- Allowing all/different file type uploads
- resize images not crop
- Trying to add filename over image in Media Browser
- How Can I pass an image file to wp_handle_upload?
- Allowed memory size exhausted. WordPress side solution
- How to hook into wordpress admin upload iframe?
- frontend upload return async-ajax.php 302
- How can I upload a file with no extension
- how to change max file upload size WordPress 4.9.8 [closed]
- How to overwrite wp_unique_filename logic
- How to change upload directory based on frontend form input name or ID?
- capability for upload on front-end (An error occurred in the upload. Please try again later )
- How to solve: An error occured in the upload
- Can I stop wordpress generating media sizes
- Unable to create directory uploads/2018/12. Is its parent directory writable by the server?
- Can I upload a file to the site so that it is not accessible via an HTML page?
- Calling WP Gallery Uploader/Selector From Metabox
- Stop WordPress from generating redundant image size
- WordPress 4.9.8 Trying to add filename over image in Media Browser
- Disable image thumbnails for only one upload folder
- Upload featured image from front end using media-upload.php
- Get File Object from wp.Uploader
- media_handle_sideload on a file already on server
- Capability to prevent upload of files
- wp_handle_upload: get custom checkbox value from media uploader
- Edit User Profile From Front End
- How can I upload to wp media library by foundation zurb ajax
- HTTP Error When Uploading Images with HTTPS?
- Saving file to disk receiving fopen error
- A link (not in the post) to download a specific PDF file
- uploaded images not going to /uploads folder
- Setting image upload absolute path?
- Correctly using the root directory for media uploads?
- how to change wp upload directory to another domain directory
- Populate a custom attachment metadata field with data from the image’s EXIF data?
- Disable “Create Audio Playlist” and “Create Video Playlist” in Add Media
- Change file name on upload in Media Page
- What is the URL pattern for image thumbnails + sizes?
- Setting up a HIPAA secured form / file upload
- How to make picture appear on wordpress site shared link? [closed]
- How to download files to WordPress?
- How to detect when a file has been uploaded?
- Cant upload larger than 100MB
- PDF Upload from Input Error
- Multiple images are generated in WP-content in wordpress
- Removing extra large generated images disables all crops
- MIME types not recognized by media library
- Missing a temporary folder not fixed
- How to allow .xls file uploads?
- Updating the attachment from front end doesn’t show the new change
- wp_update_attachment_metadata breaks after 10 files
- Media URL slugs without uploads folder path
- Add more field on WordPress media upload
- Frontend media shows “An error occurred in the upload. Please try again later.”
- File Upload Management
- Video limit about wordpress
- Can i add flickr,imgur etc. up-loader for my WP upload media button?
- Files larger than 500 kilobytes are not allowed
- get the post thumbnail returns the full size
- All files unattached in Media Library
- WordPress media upload multiple images
- Media Upload Directory to MMYY instead of YYYY/MM
- Auto-Import of WXR File
- how upload images and videos to specific folder like wp-content\uploads\folder-name
- Media upload takes too long
- Problems with defining UPLOADS constant
- Create media folder upon post publish?