maybe this might help you...
I didn't test it though!
<?
$string = "bla bla bla"; // this can be a variable string or a row from a sql query or something else...
$ext = "mpeg"; // file extension
$mime_type = 'video/x-mpeg';
header('Content-Type: ' . $mime_type);
if (PMA_USR_BROWSER_AGENT == 'IE')
{
header('Content-Disposition: inline; filename="' . $filename . '.' . $ext . '"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
print $string;
} else {
header('Content-Disposition: attachment; filename="' . $filename . '.' . $ext . '"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');
print $string;
}
?>