<?php
$xls =
"<?xml version='1.0' encoding='UTF-8'?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>";
header('Content-Description: File Transfer');
header("Content-Disposition: attachment; filename=XMLFile.xml");
header("Content-Type: application/xml; charset=utf-8");
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
print_r($xls);
?>
Update
<?php
$file = "https://site.kz/file-xml.php"; //$_POST['link'] $_GET['link']
if (!empty($file)) {
header('Content-Description: File Transfer');
header("Content-Disposition: attachment; filename=XMLFile.xml");
header("Content-Type: application/xml; charset=utf-8");
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
print_r(file_get_contents($file)) ;
}
?>
update 0.1
<?php
$file = "http://hadleybags.ru/bitrix/catalog_export/partner.php"; //$_POST['link'] $_GET['link']
if (!empty($file)) {
header('Content-Description: File Transfer');
header("Content-Disposition: attachment; filename=XMLFile.xml");
header("Content-Type: application/xml; charset=utf-8");
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
$xml_data = file_get_contents($file);
$ch = curl_init($file);
curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
$output = curl_exec($ch);
curl_close($ch);
}
?>
header("Content-type: text/xml");