Re: PHP segély
egyedül az internet Explorer olyan 'hülye' hogy keljen neki ilyen ostobaság... De tényleg, minden másik böngészőben letöltődik egy direkt linken a fájl, kivéve a videofájlokat és az mp3-mat, amit lejátszik de lementhető ...
<?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;
}
?> $f = @fopen('fájlnév', 'rb');
if ( ! $f)
{
Exit('A fájl nem elérhető.');
}
// ide jöhetnek a headerek
while ( ! feof($f))
{
echo fread($f, 1024 * 1024);
ob_flush();
flush();
}