setFetchMode(DB_FETCHMODE_ASSOC); $locStor = &new LocStor(&$dbc, $config); function http_error($code, $err){ header("HTTP/1.1 $code"); header("Content-type: text/plain; charset=UTF-8"); echo "$err\r\n"; exit; } $sessid = $_REQUEST['sessid']; $gunid = $_REQUEST['id']; $res = $locStor->existsAudioClip($sessid, $gunid); if(PEAR::isError($res)){ http_error(500, $res->getMessage()); } $ac =& StoredFile::recallByGunid(&$locStor, $gunid); if(PEAR::isError($ac)){ http_error(500, $ac->getMessage()); } $realFname = $ac->_getRealRADFname(); $mime = $ac->rmd->getMime(); header("Content-type: $mime"); readfile($realFname); ?>