head     1.1;
branch   1.1.1;
access   ;
symbols  webdox:1.1.1.1 start:1.1.1.1 mesian:1.1.1.1 Branch:1.1.1;
locks    ; strict;
comment  @# @;


1.1
date     2004.01.16.02.54.21;  author spike;  state Exp;
branches 1.1.1.1;
next     ;

1.1.1.1
date     2004.01.16.02.54.21;  author spike;  state Exp;
branches ;
next     ;


desc
@@



1.1
log
@Initial revision
@
text
@<?

include_once "./setting.php";
include_once $global["root"] . "/include/handle.php";
include_once $global["root"] . "/include/print_array.php";

include_once $global["root"] . "/lib/Site.php";

$Site = new Site;
$Site->init();
$Site->set_permission("user");

include_once $global["lang"] . "/" . $_SESSION["config_lang"] . ".php";

extract($_GET);

$SQL_GET_DOC_FILE =
	"select SQL_CACHE realname, storedname, mime_type from doc_%s where no = '%s'";

$a = $Site->DB->fetch_one(sprintf($SQL_GET_DOC_FILE, $_SESSION["config_id"], $no));

if (! $a["size"] < 1 or !$a["realname"]) goprev();

$storedfile = $global["data"] . "/doc/" .
	$_SESSION["config_id"] . "/" . $a["storedname"];

if (! file_exists($storedfile)) goprev();

// send it.
Header("Content-type: " . $a["mime_type"]);

if ($a["realname"]) {
	$url = "Content-Disposition: inline; filename=\"" . $a["realname"] . "\"";

	$Site->end1();

	Header($url);
}

readfile($storedfile);


/*
Description
-----------

Author
------
 Spike^ekipS <spike@@spikeekips.net>

Changelog
---------

Usage
-----

*/

?>
@


1.1.1.1
log
@Mesian
@
text
@@
