<% include("intecol.inc"); $cnttyp = array(); $cnttyp['pdf']='application/pdf'; $cnttyp['swf']='application/x-shockwave-flash'; $cnttyp['ppt']='application/vnd.ms-powerpoint'; $cnttyp['doc']='application/msword'; $cnttyp['zip']='application/zip'; $cnttyp['xls']='application/vnd.ms-excel'; $cnttyp['jpg']='image/jpeg'; $cnttyp['asf']='application/vnd.ms-asf'; $cnttyp['aif']='audio/x-aiff'; $cnttyp['mov']='video/quicktime'; $cnttyp['mpg']='video/mpeg'; $cnttyp['avi']='video/x-msvideo'; // if (isset($_GET["frm"]) && $link = intecol_beheer_connect() ) { $frm = $_GET["frm"]; $query = "SELECT doc,downers,LENGTH(doc) AS length FROM invited_all WHERE abstract = '".$frm."' AND doc IS NOT NULL"; if ($result = mysql_query ($query) ) { if ($row = mysql_fetch_array($result)) { $doc = $row["doc"]; $aantal = $row["downers"]; $length = $row["length"]; mysql_free_result($result); if ($length > 0) { $ct = 'application/octet-stream'; if (preg_match("'\.pdf$'",$frm,$matches)){ $ct = $cnttyp["pdf"]; } if (preg_match("'\.doc$'",$frm,$matches)){ $ct = $cnttyp["doc"]; } if (preg_match("'\.zip$'",$frm,$matches)){ $ct = $cnttyp["zip"]; } if (preg_match("'\.ppt$'",$frm,$matches)){ $ct = $cnttyp["ppt"]; } if (preg_match("'\.swf$'",$frm,$matches)){ $ct = $cnttyp["swf"]; } if (preg_match("'\.xls$'",$frm,$matches)){ $ct = $cnttyp["xls"]; } //$ct = $cnttyp["doc"]; //header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Datum in het verleden //header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Altijd veranderd //header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 //header("Cache-Control: post-check=0, pre-check=0", false); //header("Pragma: no-cache"); // HTTP/1.0 //header("Cache-control: private"); header("Content-type: ".$ct); //header("Referer: http://www.bio.uu.nl/intecol/programme/list.php", true); //header("Content-type: application/octet-stream\n"); header("Content-Disposition: Inline; filename=".$frm); //header("Content-Transfer-Encoding: binary"); header("Content-length: ".$length); header("Connection: close"); echo $doc; $aantal++; $query = "UPDATE invited_all SET downers = $aantal WHERE abstract = '$frm'"; if ($result = mysql_query ($query) ) { } else { $e = mysql_error(); } //print("

$file

"); } else { print("

Not Found

"); } } else { print("

Niets gevonden

"); } } else { print("

Query error

"); } } else { print("Niet gevonden

Niet gevonden

Er is een fout opgetreden.
Probeer het later nog een keer.

"); } %>