I have a blob which we receive from a Firebird 3.0 database.
if($dbh = ibase_connect($db,$username,$password, 'UTF-8')){
echo "Connecton steht zur Firebird DB steht! <br>";
$sql = "SELECT MEMO FROM DMS where ID = '44'";
// Execute query
$rc = ibase_query($dbh, $sql);
// Get the result row by row as object
$data = ibase_fetch_object($rc);
$blob_data = ibase_blob_info($data->MEMO);
$blob_hndl = ibase_blob_open($data->MEMO);
$inhalt = ibase_blob_get($blob_hndl, $blob_data[0]);
With
ibase_blob_echo($data->MEMO)
there comes a lot of signs in browser, so the SQL query works. Now I'd like to write the content (its a PDF) in a pdf file on disk.
Every try didn't succeed:
file_put_contents('test.pdf', $inhalt);
file_put_contents('test.pdf', ibase_blob_echo($data->MEMO));
and much more.
When we try to open the PDF File with Acrobat Reader, there comes an error message: no PDF File / File-type is not supported
How can we fix this?