0

I'm trying to upload an XML file (RSS feed) as part of a product in the WP-Ecommerce plug-in.

The idea being that a customer buying the product would be given this XML file to download which ideally launch iTunes to download the balance as part of a podcast.

I can't seem to upload the .XML feed file. I can upload other file types without a problem, but that one seems to be blocked. Where would I go to allow .XML files to be uploaded? Is it a WP-ECommerce thing, a WordPress thing, or perhaps something on the hosted server itself?

1

WordPress does not allow uploads of .xml files but you can add it by adding a mime type for it. This worked for me:

function addUploadXML($mimes) {
    $mimes = array_merge($mimes, array('xml' => 'text/xml'));.
    return $mimes;
}
add_filter('upload_mimes', 'addUploadXML');

Also, when I researched the mime type, I came up with a number of different suggestions for what to use as a mime type for xml. I just used 'text/xml' but I also saw 'application/rss+xml' and 'application/xml' among others.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.