if(file_exists($fname)){
$fp = fopen($fname, 'r');
header("Last-Modified: Thu, 17 Oct 2002 14:57:04 GMT");
header("Accept-Ranges: bytes");
// header("Content-Length: ".filesize($fname));
header("Cache-control: private");
// header("Cache-control: public");
$save_as_name = $row['titel'].".".$row['dateiendung'];
$save_as_name = ereg_replace(" ","_",$save_as_name);
if($alternative!=1)
header("Content-Disposition: inline;
filename=\"$save_as_name\"");
else
header("Content-Disposition: attachment;
filename=\"$save_as_name\"");
header("Content-Type: ".$row['mimetyp']);
fpassthru($fp);
fclose($fp);
}
else
echo("error opening file");