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

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jiehuang001
Forum Commoner
Posts: 39
Joined: Mon May 12, 2003 12:53 pm

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

Post 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);
?>
User avatar
coolpravin
Forum Newbie
Posts: 20
Joined: Mon May 19, 2003 12:56 am
Location: India

Try this

Post 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.
Post Reply