Fellow jedi, I need help in Force Download -> PROBLEM SOLVED
Posted: Sun Jul 27, 2008 7:19 pm
Hi all,
I have a code that is supposed to download an xml file. The download is working only that when the xml file has been downloaded, there are HTML tags inserted along with it:
It looks like this:
<html>
<body>
<?xml ?>
<tag1>
<subtag1>
</subtag1>
</tag1>
</body>
</html>
I want to get the xml file only.... I wonder why those html tags were inserted... when I checked the source file, it only contains xml tags... anyway here's my code:
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: text/xml");
header('Content-Disposition: attachment; filename="XMLforupload.xml"');
readfile("XMLforupload.xml");
I have tried looking for a solution but google can't seem to find a good match... any help is much appreciated.
I have a code that is supposed to download an xml file. The download is working only that when the xml file has been downloaded, there are HTML tags inserted along with it:
It looks like this:
<html>
<body>
<?xml ?>
<tag1>
<subtag1>
</subtag1>
</tag1>
</body>
</html>
I want to get the xml file only.... I wonder why those html tags were inserted... when I checked the source file, it only contains xml tags... anyway here's my code:
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: text/xml");
header('Content-Disposition: attachment; filename="XMLforupload.xml"');
readfile("XMLforupload.xml");
I have tried looking for a solution but google can't seem to find a good match... any help is much appreciated.