893f4da173
Modification de certains chemins Ajout du framework dans l'extranet
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
session_cache_limiter("private_no_expire");
|
|
if (!session_id()) { session_start(); }
|
|
|
|
$filename = null;
|
|
if (isset($_GET))
|
|
{
|
|
$image = $_SESSION[$_GET["img"]];
|
|
if (isset($_GET["filename"]))
|
|
$filename = $_GET["filename"];
|
|
}
|
|
else
|
|
{
|
|
$image = $HTTP_SESSION_VARS[$HTTP_GET_VARS["img"]];
|
|
if (isset($HTTP_GET_VARS["filename"]))
|
|
$filename = $HTTP_GET_VARS["filename"];
|
|
}
|
|
|
|
$contentType = "text/html; charset=utf-8";
|
|
if (strlen($image) >= 3)
|
|
{
|
|
$c0 = ord($image[0]);
|
|
$c1 = ord($image[1]);
|
|
$c2 = ord($image[2]);
|
|
if (($c0 == 0x47) && ($c1 == 0x49))
|
|
$contentType = "image/gif";
|
|
else if (($c1 == 0x50) && ($c2 == 0x4e))
|
|
$contentType = "image/png";
|
|
else if (($c0 == 0x42) && ($c1 == 0x4d))
|
|
$contentType = "image/bmp";
|
|
else if (($c0 == 0xff) && ($c1 == 0xd8))
|
|
$contentType = "image/jpeg";
|
|
else if (($c0 == 0) && ($c1 == 0))
|
|
$contentType = "image/vnd.wap.wbmp";
|
|
else if (($c0 == 0x1f) && ($c1 == 0x8b))
|
|
header("Content-Encoding: gzip");
|
|
}
|
|
|
|
header("Content-type: $contentType");
|
|
if ($filename != null)
|
|
header("Content-Disposition: inline; filename=$filename");
|
|
print $image;
|
|
?>
|