aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ogs/assetserver/index.php
blob: 82cf9d4728812171441fa4de9e2b33136d65eac1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?
error_reporting(0); // Remember kids, PHP errors kill XML-RPC responses and REST too! will the slaughter ever end?

include("assetserver_config.inc.php");

// Parse out the parameters from the URL
$params = str_replace($asset_home,'', $_SERVER['REQUEST_URI']);
$params = split('/',$params);

// Die if the key doesn't match
if($params[1]!=$sim_recvkey) {
    die();
}

// Send requested data
switch($params[0]) {
    case 'getasset':
	if($params[3]=="data") {
		Header("Content-Length: ". (string)filesize($asset_repos . "/" . $params[2] . "/data"));
		readfile($asset_repos . "/" . $params[2] . "/data");
	}
    break;
}
?>