'php.ini',
'post_max_size',
'upload_max_filesize'
);
} return call_user_func_array( $upload_error_handler, array
( &
$file,
$error_msg ) );
} // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
if ( $test_type ) { $wp_filetype =
wp_check_filetype_and_ext( $file['tmp_name'
],
$file['name'
],
$mimes );
$ext =
empty( $wp_filetype['ext'
] ) ? '' :
$wp_filetype['ext'
];
$type =
empty( $wp_filetype['type'
] ) ? '' :
$wp_filetype['type'
];
$proper_filename =
empty( $wp_filetype['proper_filename'
] ) ? '' :
$wp_filetype['proper_filename'
];
// Check to see if wp_check_filetype_and_ext() determined the filename was incorrect.
if ( $proper_filename ) { $file['name'
] =
$proper_filename;
} if ( ( !
$type || !
$ext ) && !
current_user_can( 'unfiltered_upload'
) ) { return call_user_func_array( $upload_error_handler, array
( &
$file,
__( 'Sorry, you are not allowed to upload this file type.'
) ) );
}