Location: PHPKode > projects > TVEz - Media Library > tvez-0.2.1/html/admin/passthru.php
<?php
	if (!isset($_REQUEST["url"]))
		return;

	$url = $_REQUEST["url"];
	$ext = strrchr($url, ".");
	$ext = substr($ext, 1);
	if ($ext == "jpg" || $ext == "png" || $ext == "gif") {
		$contentType = "image/$ext";
	} else if ($ext == "htm" || $ext == "html" || $ext == "php" || $ext == "shtml") {
		$contentType = "text/html";
	} else if ($ext == "txt") {
		$contentType = "text/plain";
	} else {
		$contentType = "application/octet-stream";
	}

	$socket = fopen($url, "rb");
	header("Content-Type: $contentType");
	fpassthru($socket);
?>
Return current item: TVEz - Media Library