PHP: ociloadlob - Manual

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

search for in the

ocilogoff ociinternaldebug

Last updated: Fri, 26 Jan 2007

view this page in

# ociloadlob

(PHP 4, PHP 5)

ociloadlob -- Alias of OCI-Lob->load

## Описание

This function is an alias of: OCI-Lob->load.

add a note User Contributed Notes
ociloadlob
FaLL3N at mail dot ru
25-Dec-2006 05:49
`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
25-Oct-2006 06:34
`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!
Code:
<?php
$dbConnection=ocilogon('user','pass','data.world'); //login stuff
$sql_SelectBlob='select document_body,filename from tdocuments where id=1'; //selecting a blob field named 'document_body' with id = 1
$statement=OCIParse($dbConnection,$sql_SelectBlob);
OCIExecute($statement) or die($sql_SelectBlob.'<hr>');
if(OCIFetch($statement)) //if file exists
{
$a=OCIResult($statement,"DOCUMENT_BODY");
}
header('Content-type: application/octet-stream;');
header('Content-disposition: attachment;filename='.$_GET['name']);
print $a->load();
//browser promts to save or open the file
?>
Have fun!`
add a note
ocilogoff ociinternaldebug

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST