Create($image_db,$image_user,$image_host,$image_pass); // get the data $query = "select image_data, filetype, filesize, filename from $IMAGE where about_id='".ass($about_id)."'"; $data = $sql_image->mydata($query); if(trim($data[image_data][0])=='') { exit(); } $image = $data[image_data][0]; $type = ss($data[filetype][0]); $length = ss($data[filesize][0]); $filename = ss($data[filename][0]); // feed it to the browser // Header("Content-disposition: filename=".$filename); // Header( "Content-type: $type/pjpeg"); // Header("Content-length: $length"); echo $image; $fp = fopen("../../../cache_image/$about_id", 'w'); fwrite($fp, $image); fclose($fp); exit(); } ?>