Subject | ibase_blob_echo not retrieving file |
---|---|
Author | Sakhile Njoko |
Post date | 2013-02-28T21:33:01Z |
I have the following script to download a file from the database but it is not working.
/*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.
System details:
PHP version: 5.3.13
Ubuntu: 11.04 (x64)
Firebird: 2.5-super
Regards,
Sakhi
[Non-text portions of this message have been removed]
/*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.
System details:
PHP version: 5.3.13
Ubuntu: 11.04 (x64)
Firebird: 2.5-super
Regards,
Sakhi
[Non-text portions of this message have been removed]