SOLVED: Look at this comment!
I have this php page echoing some xml data, which the user should save. I want the page to automatically open the "Save as" window, since the page downloading the data is called "download.php" this won't start a "Save as" by it self. I read a lot of other threads here on stackoverflow by people asking the same question. None of those solves my problem. So yes, I am creating a duplicate by purpose.
This is my code:
$file.='<bpage>';
$file.='<title>'.$_POST["title"].'</title>';
$file.='<desc>'.$_POST["desc"].'</desc>';
$file.='<cont>'.$_POST["cont"].'</cont>';
$file.='<img>'.$_POST["img"].'</img>';
$file.='<tdata>'.$_POST["tdata"].'</tdata>';
$file.='<link>'.$_POST["link"].'</link>';
$file.='<writer>'.$_POST["writer"].'</writer>';
$file.='<date>'.$_POST["date"].'</date>';
$file.='</bpage>';
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=".$_POST["title"].'.bpage');
echo $file;
I am not having any "Save as" dialog, simply the usual page, as if it ignored all my headers. I am using Chrome and the latest version of PHP.
--
Regards Locercus
Edit: I am using One.com for hosting. Could they possibly be blocking the header function?