Skip to content
Advertisement

Can’t display medium size pdf blob from database

I’m trying to display my PDFs stored in a MariaDB database on my XAMPP server via HTML and PHP

Code:

JavaScript

It works for PDFs with a size of 500kB but for PDFs with the larger size, the Page stays blank.

Is there any configuration I have to do in my XAMPP conf files? I tried to increase pretty much all of them nothing seems to work
Edit: I’m using "SELECT test from PDF WHERE testID = 1" with the function

JavaScript

to populate the var $this->view_data so the PDF is stored in $this->view_data[0][“test”]

It works fine for everything blobsize <= 500kB. I tried setting the PDO MYSQL_ATTR_MAX_BUFFER_SIZE but the variable is not even initialized.

Advertisement

Answer

I found the answer. It was because I didn’t use PDOs statements for LOBs (large objects) With

JavaScript

It works.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement