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.
Fellow jedi, I need help in Force Download -> PROBLEM SOLVED
Moderator: General Moderators
Fellow jedi, I need help in Force Download -> PROBLEM SOLVED
Last edited by deeessay on Mon Jul 28, 2008 8:14 pm, edited 1 time in total.
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Fellow jedi, I need help in Force Download
Maybe these 2 examples can help...
Step 1. Create XML file...
http://www.forum.jaoudestudios.com/view ... ?f=33&t=74
Step 2. Force Download...
http://www.forum.jaoudestudios.com/view ... p?f=13&t=8
Step 1. Create XML file...
http://www.forum.jaoudestudios.com/view ... ?f=33&t=74
Step 2. Force Download...
http://www.forum.jaoudestudios.com/view ... p?f=13&t=8
Re: Fellow jedi, I need help in Force Download
ah finally! a reply!
thanks so much for replying! I'll check the site right away!
thanks so much for replying! I'll check the site right away!
Re: Fellow jedi, I need help in Force Download
Hi, I tried the force download function and I still got the same result -- there are still html tags added to my xml file.... argh this is driving me nuts!!!
please help me!!!

please help me!!!
Re: Fellow jedi, I need help in Force Download
Nevermind the last post, I got the code working!
Thanks, jaoudestudios for your assistance!
good day!
Thanks, jaoudestudios for your assistance!
good day!