Hi all,
I need to allow users to a website to download info from the database, and as it's of heirarchical nature I'm planning on formatting that data in XML.
Idea is they click on a link in one page that opens a second PHP script, that will read the right data out, produce the XML and output that in a format that makes it force a download immediately, rather than dump it into the browser window.
<?php
header("Content-Type: text/xml");
header("Content-Disposition: attachment; filename=yourdb.xml;");
echo '<?xml version="1.0" ?>';
echo "<clients><client><name>Dan Searle</name><email>not.my@email.com</email></client></clients>";
?>
That's a reduced example of course, but that code works in Win/Opera7.5 - but not in Win/IE6. IE opens the filesave dialog, but gets the filename wrong (it shows a corrupted version of the script's filename) and when I try to save, it just fails. Opera gets the name right and saves it correctly.
What does IE want me to do to make this work? Or is there an alternative approach that someone could suggest?
Thanks for any help!