Skip to main content
edited body
Source Link
Vinod Dalvi
  • 5.9k
  • 4
  • 34
  • 51

The file types that you have specified 'application/msword', 'application/vnd.ms-excel', 'application/pdf' are already supported by media uploader.

To see the default supported mime file types, call wp_get_mime_types() function.

Use upload_mimes filter as shown in following code to make media uploader to accept files types other than the default.

To see the default supported mime file types, call wp_get_mime_types() function.

Add following code in your themes functions.php file

// 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; 
}

The file types that you have specified 'application/msword', 'application/vnd.ms-excel', 'application/pdf' are already supported by media uploader.

Use upload_mimes filter as shown in following code to make media uploader to accept files types other than the default.

To see the default supported mime file types, call wp_get_mime_types() function.

Add following code in your themes functions.php file

// 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; 
}

The file types that you have specified 'application/msword', 'application/vnd.ms-excel', 'application/pdf' are already supported by media uploader.

To see the default supported mime file types, call wp_get_mime_types() function.

Use upload_mimes filter as shown in following code to make media uploader to accept files types other than the default.

Add following code in your themes functions.php file

// 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; 
}
Source Link
Vinod Dalvi
  • 5.9k
  • 4
  • 34
  • 51

The file types that you have specified 'application/msword', 'application/vnd.ms-excel', 'application/pdf' are already supported by media uploader.

Use upload_mimes filter as shown in following code to make media uploader to accept files types other than the default.

To see the default supported mime file types, call wp_get_mime_types() function.

Add following code in your themes functions.php file

// 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; 
}