0){ $strSQL = "SELECT id,nama,type,size FROM tweb_uploads WHERE id=".$id; $resu1t = mysql_query($strSQL); if($resu1t){ if(mysql_num_rows($resu1t)>0){ $rs = mysql_fetch_assoc($resu1t); $strnama = $rs["nama"]; $ext = substr($strnama,strpos($strnama,".",2)); if($ext == ".mp3"||$ext == ".avi"||$ext == ".mpg"||$ext == ".wma"||$ext == ".wmv"){ $pathUL = "./content/media/"; }elseif($ext == ".doc"||$ext == ".xls"||$ext == ".ppt"||$ext == ".pdf"||$ext == ".odt"||$ext == ".ods"||$ext == ".odp"||$ext == ".tar"||$ext == ".zip"||$ext == ".tgz"){ $pathUL = "./content/files/"; }elseif($file_type == "image/pjpeg" || $file_type == "image/jpeg"||$file_type == "image/x-png" || $file_type == "image/png"||$file_type == "image/gif"){ $pathUL = "./content/images/"; } $file=$pathUL.$strnama; header("Content-type: ".$rs["type"].""); header("Content-Transfer-Encoding: Binary"); header("Content-length: ".$rs["size"]); header("Content-disposition: attachment; filename=\"".basename($file)."\""); readfile("$file"); } } } ?>