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("connec tion.php");
$query = "SELECT resource, resource_name FROM tblresources WHERE id =
'3' ";
$result = mysql_query($qu ery) or die(mysql_error () );
$row = mysql_fetch_arr ay($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!
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("connec tion.php");
$query = "SELECT resource, resource_name FROM tblresources WHERE id =
'3' ";
$result = mysql_query($qu ery) or die(mysql_error () );
$row = mysql_fetch_arr ay($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!
Comment