![]() ![]() Then, we can select the PDF data and render it in the web browser as follows: $a = $blobObj->selectBlob( 2) Įcho $a Code language: PHP ( php ) $blobObj->insertBlob( 'pdf/php-mysql-blob.pdf', "application/pdf") Code language: PHP ( php ) The following code inserts the content of the pdf/php-mysql-blob.pdf PDF file into the BLOB column: $blobObj = new BlobDemo() Then, we can select the BLOB data and display it as a GIF image: $a = $blobObj->selectBlob( 1) Įcho $a Code language: PHP ( php ) PHP MySQL BLOB with PDF files $blobObj->insertBlob( 'images/php-mysql-blob.gif', "image/gif") Code language: PHP ( php ) PHP MySQL BLOB with image filesįirst, we insert binary data from the images/php-mysql-blob.gif file into the BLOB column of the files table as follows: $blobObj = new BlobDemo() In the following examples, we will use the BlobDemo class to save a GIF image and a PDF file into the BLOB column of the files table. */ public function insertBlob ($filePath, $mime) Code language: PHP ( php ) PHP MySQL BLOB examples See the following insertBlob() method: /**
0 Comments
Leave a Reply. |