PHP 7.4.24 Released!


(No version information available, might only be in Git)

OCI-Lob::loadDevuelve el contenido de un objeto grande


OCI-Lob::load(): string

Devuelve el contenido de un objeto grande. Ya que la ejecución de un script finaliza cuando se alcanza el valor de memory_limit, asegúrese de que el LOB no execede dicho límite. En la mayoría de los casos se recomienda usar en su lugar OCI-Lob::read.

Valores devueltos

Devuelve el contenido del objeto, o false en caso de error.

Ver también

add a note add a note

User Contributed Notes 2 notes

FaLL3N at mail dot ru
14 years ago
Ps. To prevent IE errors like 'File not found!' after downloading file from db I recommend to add next two lines into header:
header('Cache-Control: max-age=0');
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

With this, IE will open any file normally :)
FaLL3N at mail dot ru
14 years ago
I'll give you example how to download a file from db without storing it on server's FS:
It works like this - point yor browser to index.php?name=file.ext
Just make sure that file "file.ext" exists in your db!



=ocilogon('user','pass',''); //login stuff
$sql_SelectBlob='select document_body,filename from tdocuments where id=1'; //selecting a blob field named 'document_body' with id = 1

OCIExecute($statement) or die($sql_SelectBlob.'<hr>');

OCIFetch($statement)) //if file exists
header('Content-type: application/octet-stream;');
header('Content-disposition: attachment;filename='.$_GET['name']);

//browser promts to save or open the file

Have fun!
To Top