<?php

include_once dirname(__FILE__).'/class.record.php';
if (!isset($gCms)) exit;

//$position = $_GET['position'];

if (!isset($params['recordid'])) return "erreur";

$record = new pRecord();
$record->loaddb($params['recordid']);

$check = $record->checkfile();

if ($check == "remote")
	$fileurl = $record->location;
elseif ($check == "local")
	$fileurl = cms_join_path($gCms->config['uploads_url'],$record->location);

if ($check!==false)
	header("Location: ".$fileurl);
else
	echo $this->lang('unkownrecord');

?>