Raydium data repository"; ?> Raydium 3D Game Engine
 R3S message > home

"; } function home() { global $data_dir,$upload_accept; head(); echo "

Available files:

\n"; echo ""; if ($dh = _opendir($data_dir)) { while (($file = _readdir($dh)) !== false) { if($file[0]==".") continue; $size=filesize($data_dir.$file); $total_size+=$size; echo ""; } } echo ""; echo "
"; echo "You can add this URL in your rayphp/repositories.* files.
"; if($upload_accept) $up="supports"; else $up="does not supports"; echo "This server $up data uploading.

"; tail(); } function main($file,$type,$username,$password,$data) { global $data_dir,$upload,$upload_accept,$brute_force_delay; global $HTTP_POST_FILES; if($type=="") { home(); return; } $file=rawurldecode($file); $file=str_replace("/","",$file); $file=$data_dir.$file; if($type=="listRepos") { if($file==$data_dir) $file="$data_dir/*"; foreach((array)glob($file) as $file) { if($file[0]!='.') echo trim(str_replace("/","",substr($file,strlen($data_dir))))."\n"; } return; } // For all next operations, consider $file as mandatory ... if($file=="") return; if($type=="putGzip") { if(!$upload_accept) { echo "FAILED: Upload is not activated on this server !"; return; } sleep($brute_force_delay); $username=rawurldecode($username); $password=rawurldecode($password); if($username!=$upload["user"] || $password!=$upload["pass"]) { echo "FAILED: invalid user/pass ($username/$password)"; return; } $filegz=$file.".tmp.gz"; if(file_exists($HTTP_POST_FILES["data"]["tmp_name"])) { move_uploaded_file($HTTP_POST_FILES["data"]["tmp_name"], $filegz); } else die("FAILED: Cannot find data in this request"); if(!decompress_file($filegz,$file)) return; chmod($file,0664); echo "+ SUCCESS: file uploaded"; return; } if(!file_exists($file)) die("FAILED: file not found"); if($type=="getGzip") { $fp=fopen($file,"rb"); if(!$fp) die("FAILED: file not found"); $data=fread($fp,filesize($file)); fclose($fp); $tmp=tempnam("./","delme"); $fp=gzopen($tmp,"wb"); if(!$fp) return; gzwrite($fp,$data); gzclose($fp); //$dat=gzencode($data); //echo $dat; //echo date("s"); readfile($tmp); unlink($tmp); //echo $tmp; } if($type=="getDate") { echo filemtime($file); } if($type=="getBin") { header('Content-type: application/octet-stream'); header('Content-Transfer-Encoding: Binary'); header('Content-length: '.filesize($file)); header('Content-Disposition: attachment; filename="'.basename($file).'"'); readfile($file); } } // end main() main(GorP("file"),GorP("type"),GorP("username"),GorP("password"),GorP("data")); ?>
$file$size byte(s) ".date("Y-m-d H:i:s",filemtime($data_dir.$file))."
 
Total size".sprintf("%.2f",$total_size/1024/1024)." MB