<?php
// Parameters of the file
$file["type" ] = "text/plain"; // Read more about mime-types:
http://www.tanit.hu/mimetypes
$file["name" ] = "proba.txt";
$file["content"] = "This is the content of the file...";
pushfile($file);
//------------------------------------------------------------------------------
// Send a file to the browser
function pushfile(&$file) {
if (isset($file["type"])) header('Content-Type: '.$file["type"]);
if (isset($file["name"])) header('Content-Disposition: attachment; filename="'.$file["name"].'"');
// header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: ");
echo $file["content"];
exit;
}
?>