What is the URL of your blog, and where/how/why are you trying to upload an XML file?
I’m uploading it because I have to share it, downloadable from my site.
I’m trying to uploading it by media uploader. So it’d will be on uploads/ dir.
Ah, ok. The Media uploader only uploads certain files: http://codex.wordpress.org/Uploading_Files#About_Uploading_Files_with_WordPress
The easiest way around that is to of course upload the file via SFTP or FTP instead: http://codex.wordpress.org/FTP_Clients
Another way around it is to add this to your theme functions file, which apparently does work, but I honestly never recommend things like this (when FTP is perfectly doable option):
add_filter('upload_mimes', 'custom_upload_xml');
function custom_upload_xml($mimes) {
$mimes = array_merge($mimes, array('xml' => 'application/xml'));
return $mimes;
}
via http://ernieleseberg.com/xml-uploads-in-wordpress/
I have code that does a similar thing as James posted recently.
Here’s how you can add any file type that can be uploaded as I have used some sample code including a line for xml files. This can be also useful for clients who want to upload files on the site if that is ever an option.
add_filter('upload_mimes', 'custom_upload_mimes');
function custom_upload_mimes ( $existing_mimes=array() ) {
// add your ext => mime to the array
$existing_mimes['tif'] = 'image/tif';
$existing_mimes['eps'] = 'image/eps';
$existing_mimes['zip'] = 'application/zip';
$existing_mimes['rar'] = 'application/x-rar-compressed';
$existing_mimes['xml'] = 'application/xml';
// add as many as you like
// and return the new full result
return $existing_mimes;
}