<?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();
}
Vissza: Segédletek, Tippek, Egyebek
Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 0 vendég