Hi!
I have a mysql-database with some pdf in it.
I can send them to a webbrowser using this script:
<?php
//output.php4
$sql = "SELECT * FROM tbfiles WHERE tbfiles.ID={$id}";
$result = mysql_query($sql);
$dateien = mysql_fetch_object($result);
$daten = $dateien->Inhalt;
$name = $dateien->Dateiname;
$groesse = $dateien->Groesse;
$typ = $dateien->Typ;
header("Content-type: $typ");
header("Content-length: $groesse");
header("Content-Disposition: attachment; filename=$name");
echo $daten;
?>
My problem is that I get a download dialog where I want to save the pdf but
I want to open it in a fram or iframe like this:
<iframe src="./output.php4?id=129" width="100%" height="400"
name="outputbox">
where id=129 indicates my document.
I get the correct result in Internet Explorer (but not in Opera) if I change
the script like this:
header("Content-type: image/jpeg");
header("Content-Disposition: inline; filename=$name");
Does anybody know a solution for Opera? Then I could provide different
scripts depending on the browser.
Or even better a solution working in all browsers?
Thank you very much.
Best wishes
Martin