Top

[Web] ÆÄÀÏ ´Ù¿î·Îµå½Ã ÇÑ±Û ÆÄÀÏ À̸§ ±úÁü Çö»ó | Web-Programing
ÀÌ°­Çö (lkhtt) | Html | 2012/11/07 13:05:54 | Á¶È¸:15024
÷ºÎÆÄÀÏ (1)




À§ÀÇ ±×¸²Ã³·³ ÇÑ±Û ÆÄÀÏ ´Ù¿î·Îµå ½Ã¿¡ ÇÑ±Û ÆÄÀÏ À̸§ÀÌ ±úÁö´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù.

ÀÌ·²¶§¿¡´Â

$ie= isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false;

//IEÀΰæ¿ì ÇѱÛÆÄÀϸíÀÌ ±úÁö´Â °æ¿ì¸¦ ¹æÁöÇϱâ À§ÇÑ ÄÚµå
if($ie)
{
$file_name = iconv('UTF-8', 'euc-kr', $file_name);
}


Çì´õ ºÎºÐ¿¡ Ãß°¡
if($ie)
{
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header("Content-Transfer-Encoding: binary");
header('Pragma: public');
}
/*********************************************************************************
ÇØÁÖ°í ½ÇÇàÇÏ¸é ¿Ø¸¸ÇÑ °æ¿ì¿¡´Â ÇѱÛÀÌ ±úÁöÁö ¾Ê°í ³ª¿À°Ô µË´Ï´Ù. À§ÀÇ ºÎºÐÀÌ Ãß°¡µÇ¾ú´Âµ¥µµ µÇÁö ¾ÊÀ» °æ¿ì¿¡´Â

if (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
{
// IE: rawurlencode()
$fn = preg_replace('/[:x5c/*?"<>|]/', '_', $file_name);
$file_name=rawurlencode($fn);
// fix IE bug
$file_name = preg_replace('/./', '%2e',$file_name, substr_count($file_name, '.') - 1);
}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'Opera'))
{
// Opera 9: RFC 2231
$fn = preg_replace('/[:x5c/{?]/', '_', $file_name);
$file_name=rawurlencode($fn);
}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'Chrome'))
{
// Chrome
$fn = preg_replace('/[:x5c/{?]/', '_', $file_name);
$file_name=rawurlencode($fn);
}
else
{ // Mozilla: RFC 2047
$file_name=base64_encode($file_name);
}
Çì´õ À§ ÂÊ ºÎºÐ¿¡ À§ÀÇ 4°¡Áö if ±¸¹®µéÀ» Ãß°¡ÇØÁÖ¸é ÇѱÛÀÌ ±úÁöÁö ¾Ê°í ³ª¿À°Ô µË´Ï´Ù.

ÇØ´ç ±¸¹®µéÀº ³×À̹ö ºí·Î±×µîÀ» ÅëÇÏ¿© °Ë»ö °á°ú·Î ³ª¿Â ¿¹Á¦µéÀ» ±âÃÊ·Î ¸¸µé¾îÁ® ÀÖ½À´Ï´Ù.
°øÀ¯Çϱâ
°øÀ¯Çϱâ
1
0
0


´ñ±ÛÀ» ºÒ·¯¿À´Â ÁßÀÔ´Ï´Ù.
¡ã ÀÌÀü±Û [WEB] ¹ÝÀÀÇü À¥¿¡ ´ëÇؼ­.. ±è°æÈÆ (admin) 2012-11-14 15:55:30
¡å ´ÙÀ½±Û [LINUX]¸®´ª½º Äɸ¯Åͼ ¼³Á¤, vi ¿¡µðÅÍ Äɸ¯ÅÍ ¼Â ¼³Á¤ ¾ÈÁöÈì (hoomiyam) 2012-11-02 11:07:35