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'); $sql_SelectBlob='select document_body,filename from tdocuments where id=1'; $statement=OCIParse($dbConnection,$sql_SelectBlob);
OCIExecute($statement) or die($sql_SelectBlob.'<hr>');
if(OCIFetch($statement)) {
$a=OCIResult($statement,"DOCUMENT_BODY");
}
header('Content-type: application/octet-stream;');
header('Content-disposition: attachment;filename='.$_GET['name']);
print $a->load();
?>
Have fun!