<?php
class temp {
	function temp() {
		require('../../system/data/filetypes.php');
	}
}
$t = new temp();
$ext = strtolower($_GET['ext']);

if (array_key_exists($ext, $t->filetypes)) {
	$typeInfo = $t->filetypes[$ext];
} else {
	$typeInfo = reset($t->filetypes);
}
$filename = $typeInfo[3];
if (!$filename) {
	$filename = 'generic.png';
}
header ('HTTP/1.1 301 Moved Permanently');
header('Location: '.$filename);