Allow Upload of More File Types


Sponsored Links




Why I love WordPress? It’s because many developer and designer support out there. Some of them give us nice tutorial and tricks. On this post I will share to all of you about How To allow upload of more file types in WordPress.

Allow Upload of More File Types

Allow Upload of More File Types

All need to do only added extra functions on our themes and create WordPress Hooks using standard method WordPress API. This code original created by Pioupioum and we got nice share from WP Recipes. So enjoy it.

Allow Upload of More File Types Functions

<?php
function addUploadMimes($mimes) {
    $mimes = array_merge($mimes, array(
        'tmbundle|tmCommand|tmDragCommand|tmSnippet|tmLanguage|tmPreferences' => 'application/octet-stream'
    ));
    return $mimes;
}
add_filter('upload_mimes', 'addUploadMimes');
?>

You can add more File Types on this code, by expanded on Line 4 and add your own file types. I hope tutorial How To Allow upload of more file types in WordPress work on you.

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

Manual:Configuring file uploads - MediaWiki

Read more about PHP file uploads at File upload basics and in particular move_uploaded_file. to allow most types of file to be uploaded. However, blacklisted filetypes Read More

Accepted Filetypes — Support — WordPress.com

With the purchase of the VideoPress you are permitted to upload the following video file types From our blog Read more… 7 Food Blogs to Follow This Summer Read More

PHP: Handling file uploads - Manual

- As I need 100MB, I allow air above for the file (110M) and a bit more you are able to upload more, but the file arr file_types [, int file_size [, str upload_dir ]]]]); Read More

scripts.mit.edu: How do I enable file uploads to my MediaWiki?

To upload more file types, you will also need to add lines such as each extension (.doc and .pdf in this example) you would like to allow your site to upload. Read More

Uploading Files Using the File Field Control

Summary: Learn how to use the Microsoft ASP.NET File Field control to allow your end-users to upload one or more File Size Limitations Controlling Uploaded File Types Read More


8 Responses to Allow Upload of More File Types

  1. lily says:

    good post and thank you

  2. Avi D says:

    Hi,

    Could you write out a full example please? I’m not sure I follow your code…

  3. Pingback: Tutorial and Trick Upload Wordpress Theme | Silver Blog

  4. Pingback: WordPress for Android | Silver Blog

  5. That’s a good tip, i know there are many people out there having trouble with this issue and looking for such explications. You should consider talking about file types and how are they working too, you seem to be qualified for such an article. There are more and more new file extensions appearing these days and they can be very confusing, they even make me feel frustrated sometimes.

  6. Ryan Crozier says:

    Thanks for the tip. That was always something that bugged me. I’m going to be an uploading fool tonight!

  7. Brautkleider says:

    That’s a good tip, i know there are many people out there having trouble with this issue and looking for such explications. You should consider talking about file types and how are they working too, you seem to be qualified for such an article. There are more and more new file extensions appearing these days and they can be very confusing, they even make me feel frustrated sometimes.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>