Page 1 of 1

how to show the "File download" box instead of pri

Posted: Fri May 23, 2003 1:19 pm
by jiehuang001
I have successfully used the following code to print a text file from an Oracle blob field to the screen. How should I change this code so that the "File download" window will pop up instead.

-----------code to print a text file out-----------------
<?php
$conn = OCILogon("scott", "tiger", "Daluko");
$stmt = OCIParse($conn, "select file_content from lexicon_files where id=2");

OCIExecute($stmt);
OCIFetchInto($stmt, &$blob);
echo $blob[0]->load();

OCIFreeStatement($stmt);
OCILogoff($conn);
?>

Try this

Posted: Fri May 23, 2003 11:51 pm
by coolpravin
Try to use this one

Code: Select all

<?
header("Content-Type: application/html");
header("Content-Disposition: attachment; filename=mychatsession.html");
$conn = OCILogon("scott", "tiger", "Daluko"); 
$stmt = OCIParse($conn, "select file_content from lexicon_files where id=2"); 

OCIExecute($stmt); 
OCIFetchInto($stmt, &$blob); 
echo $blob&#1111;0]->load(); 

OCIFreeStatement($stmt); 
OCILogoff($conn); 
?>
:o I had not tested it .But hope it will work.