I uploaded a pdf files to the server and I try to output its content by using file_get_contens, here's my code:
Code: Select all
$content = file_get_contents("myfile.pdf");
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=myfile.pdf");
print $content;Similar problem when I use the code above to read and output the content of a word document, it said the document has different encoding...
How do I get this to work correctly?
Don't have any hints on it, hope to hear from you all and thanks for helping.
With my best,
Jim