I have created a XML file that I want to send to the user so the user can save it as a file. Probably it is my deficiency, however I find the documentation on what should be in the Header obtuse at best. Is there some documentation that is simple?
The xml file ends as
<NrLocns>1</NrLocns>
<ApprovalDate>12/31/1969</ApprovalDate>
</QTODAY>
</dataroot>
I send it with
function send_xml($fname) {
$contents = file_get_contents($fname);
header('Content-Length: ' . strlen($contents));
header('Content-Disposition: attachment; filename="' . basename($fname) . '"');
header('Content-Type: text/xml; charset=ISO-8859-4');
print ($contents);
}
And when the file is saved by the user, it has this tacked on:
<ApprovalDate>12/31/1969</ApprovalDate>
</QTODAY>
</dataroot>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Pragma" content="no
What have I missed?
Thank you for your patience and help...
Todd