 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
Lino

Joined: 22 Apr 2009 Posts: 3 Location: Vera Cruz/RS - Brazil
|
Posted: Wed Apr 22, 2009 4:09 pm Post subject: Show a BLOB field using MDB2 |
|
|
| I would like an example of how show a BLOB field of Firebird using MDB2? |
|
| Back to top |
|
 |
tmilos1
Joined: 17 Mar 2009 Posts: 8 Location: Krusevac, Serbia
|
|
| Back to top |
|
 |
Lino

Joined: 22 Apr 2009 Posts: 3 Location: Vera Cruz/RS - Brazil
|
Posted: Thu Apr 23, 2009 9:20 pm Post subject: save a image in disk |
|
|
thanks, but now I need to save an image as a file.
I use this code to view the image:
| Code: |
<?php
Header('Content-type: image/gif');
include("./libs/AcessaKOPP.php");
$temp_sql = "SELECT FOTO FROM INTEGRANTE where cod_integrante=8";
$rs =& $mdb2->query($temp_sql, array('blob'));
$row = $rs->fetchRow();
$blob = $row[0];
if (!PEAR::isError($blob) && is_resource($blob)) {
$blob_value = '';
while (!feof($blob)) {
$blob_value .= fread($blob, 8192);
}
$mdb2->datatype->destroyLOB($blob);
}
$rs->free();
print($blob_value."\n");
// here I want to save the image as a file from the value of the variable $blob_value
?>
|
|
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1230
|
Posted: Thu Apr 23, 2009 10:30 pm Post subject: |
|
|
| Use file_put_contents() or fwrite(). |
|
| Back to top |
|
 |
Lino

Joined: 22 Apr 2009 Posts: 3 Location: Vera Cruz/RS - Brazil
|
Posted: Fri Apr 24, 2009 2:17 pm Post subject: |
|
|
| Thank you, helped me a lot |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|