I am trying to use PHP (CodeIgniter) and ODBC to fetch files (image, pdf, doc) stored in an Access database and show them in a browser. Unfortunately it returns only the first 4kb of every file.
$this->load->database();
$query = $this->db->query("select noe,file from Sanad_File
where id=$id");
$rowim=$query->result();
if($rowim[0]->noe=="pdf")
header('Content-Type: application/pdf');
else if ($rowim[0]->noe=="jpg")
header('Content-Type: image/jpeg');
else if ($rowim[0]->noe=="tif")
header('Content-Type: image/tiff');
else if ($rowim[0]->noe=="doc" || $rowim[0]->noe=="docx")
header('Content-Type: application/msword');
echo $rowim[0]->file;
I suspect that it's an ODBC issue. Can anyone help me find the solution?