Recommend this page to a friend! |
All requests ![]() |
> | Store PDF as binary in Database and r... | > | Request new recommendation | > | ![]() |
> | ![]() |
by muabshir - 8 years ago (2017-03-13)
+4 | I want to STORE PDF in database as binary and called it as PDF or Word or HTML formate |
2. by Dantigny francois - 2 years ago (2023-03-18) Reply
Pay attention : if you store a PDF file as a BLOB, you must retrieve this BLOB as PDF file ! If you store an HTML file (or a Word file) you can save it as TEXT (and retrieve it as TEXT).
1. by Dave Smith - 7 years ago (2017-04-30) Reply
pdf is already binary. You can use file_get_contents() to read the file into a variable and then save that in the database as a BLOB (binary large object).
To display it in the browser, you just need to send the appropriate content headers before you echo the data.
Recommend package | |
|