downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

OCI-Lob::flush> <OCI-Lob::erase
[edit] Last updated: Fri, 17 May 2013

view this page in

OCI-Lob::export

(PHP 5, PECL OCI8 >= 1.1.0)

OCI-Lob::exportExporte un LOB Oracle dans un fichier

Description

bool OCI-Lob::export ( string $filename [, int $start [, int $length ]] )

Exporte un LOB Oracle dans un fichier.

Liste de paramètres

filename

Le chemin vers le fichier.

start

Indique la position à partir de laquelle l'on doit commencer à exporter.

length

Indique la taille des données à exporter.

Valeurs de retour

Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.

Voir aussi



add a note add a note User Contributed Notes OCI-Lob::export - [1 notes]
up
0
AlexiuS
2 months ago
Please note, that contents of LOB is cleared after this operation. If you want to use LOB data after exporting it to file, you should read it from file with file_get_contents().

This will not work:
<?php
if($blob) {
   
$filename = DOCUMENT_ROOT."/".$bildId.".jpg";
    if(
$blob->export($filename)) {
        while(!
$blob->eof()){
           
$dbResult .= $blob->read(2000);
        }
    } else {
        throw new
Exception("Can not save the file ".$filename."!");
    }
}
?>

Use this instead:
<?php
if($blob) {
   
$filename = DOCUMENT_ROOT."/".$bildId.".jpg";
    if(
$blob->export($filename)) {
       
$dbResult = file_get_contents($filename);
    } else {
        throw new
Exception("Can not save the file ".$filename."!");
    }
}
?>

 
show source | credits | sitemap | contact | advertising | mirror sites