Subject | Re: [firebird-php] ibase_blob_echo not retrieving file |
---|---|
Author | Lester Caine |
Post date | 2013-02-28T22:14:50Z |
Sakhile Njoko wrote:
This will return the text of the blob in $rec->MNTNM rather then the blob ID
While 5.3.x is after the problem with blob id's getting messed up, it will just
prove a point ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
> I have the following script to download a file from the database but it is not working.Try ibase_fetch_object ($rslt, IBASE_TEXT )
>
> /*code to connect to database*/
> $mtgno = (int)$_GET['psp'];
> $qry = "select MINTS,MNTNM,MNTSZ from SHMT where MTGNO = '$mtgno'";
> $rslt = ibase_query($tt,$qry);
> if($rec = ibase_fetch_object($rslt))
> {
> header("Content-Disposition: attachment; filename=".$rec->MNTNM);
> header("Pragma: no-cache");
> header("Cache-Control: private");
> header("Content-Description: File Transfer");
> header("Content-Length: ".$rec->MNTSZ);
> header("Cache-control: private");
> header("Expires: Mon, 26 Jul 1982 01:00:00 GMT+2");
> ibase_blob_echo($rec->MINTS);
> exit;
> }
> else "The file cannot be downloaded.";
> /*close database connection*/
>
> $rec->MNTNM and $rec->MNTSZ are correct when I print them on the screen. When I check in the database everything is fine.
This will return the text of the blob in $rec->MNTNM rather then the blob ID
While 5.3.x is after the problem with blob id's getting messed up, it will just
prove a point ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk