$file) { $arrTmp = explode(":", $file); $filename = $arrTmp[0]; $showname = $arrTmp[1]; if($filename == $aId) { if($fp = @fopen(sprintf("attachments/%s", $filename), "rb")) { while(!feof($fp)) $data .= fgets($fp, 4096); fclose($fp); ob_end_clean(); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Disposition: attachment; filename=".$showname.";"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".strlen($data)); echo $data; die(); } } } } } ?>