You are here: problem displaying pdfs from mysql « PHP Programming Language « IT news, forums, messages
problem displaying pdfs from mysql

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация