Posted by monomaniac21 on 05/07/06 22:53
Hi I have uploaded a pdf file into my db and am trying to display it
again here is the code i have used (at the moment it is just displaying
the binary file's code as text in a html page:
<?php session_start();
include("connection.php");
$query = "SELECT resource, resource_name FROM tblresources WHERE id =
'3' ";
$result = mysql_query($query) or die(mysql_error() );
$row = mysql_fetch_array($result);
$content = $row['resource'];
header("Content-type: application/pdf");
echo $content;
?>
//am i missing something else to go with header to make it be read as a
pdf file?
Please help!
Navigation:
[Reply to this message]
|