hrms_pic.php

来自「极限网络智能办公系统 Office Automation V3.0官方100%源」· PHP 代码 · 共 57 行

PHP
57
字号
<?php
 
include_once( "inc/auth.php" );
$FB_STR1 = urldecode( $PHOTO );
if ( strstr( $FB_STR1, "/" ) || strstr( $FB_STR1, "\\" ) )
{
	exit( );
}
$URL = $ATTACH_PATH."hrms_pic/{$PHOTO}";
if ( !file_exists( $URL ) )
{
	echo "找不到文件,位于服务器:".$URL;
	exit( );
}
$file_ext = strtolower( substr( $PHOTO, strrpos( $PHOTO, "." ) + 1 ) );
switch ( $file_ext )
{
case ".jpg" :
case ".bmp" :
case ".gif" :
case ".png" :
case ".wmv" :
case ".html" :
case ".htm" :
case ".wav" :
case ".mid" :
	$COTENT_TYPE = 0;
	$COTENT_TYPE_DESC = "application/octet-stream";
	break;
case ".pdf" :
	$COTENT_TYPE = 0;
	$COTENT_TYPE_DESC = "application/pdf";
	break;
case ".swf" :
	$COTENT_TYPE = 0;
	$COTENT_TYPE_DESC = "application/x-shockwave-flash";
	break;
default :
	$COTENT_TYPE = 1;
	$COTENT_TYPE_DESC = "application/octet-stream";
}
ob_end_clean( );
header( "Cache-control: private" );
header( "Content-type: {$COTENT_TYPE_DESC}" );
header( "Accept-Ranges: bytes" );
header( "Accept-Length: ".filesize( $URL ) );
if ( $COTENT_TYPE == 1 )
{
	header( "Content-Disposition: attachment; filename=".$PHOTO );
}
else
{
	header( "Content-Disposition: ; filename=".$PHOTO );
}
readfile( $URL );
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?