 |
|
|  |
ÆÄÀÏ ´Ù¿î·Îµå2 (Çì´õ ÀÌ¿ë) |
|
|
 |
13³â Àü |
<?
/*
down.php ¸¦ »õ·Î¿î âÀ¸·Î ¶ç¿ò (popup µî)
¼³Á¤ ÆÄÀÏ ÀоîµéÀÓ dbconnection µî
include "../lib/setup.php";
´Ù¿î·Îµå ȸ¼ö Áõ°¡³ª ´Ù¸¥ºÎºÐ ³ÖÀ½
¾Æ·¡ºÎÅÍ ´Ù¿î·Îµå ºÎºÐ
file1 = ¾÷·Îµå½Ã ¿Ã¸° ÆÄÀϸí (test.zip)
sfile1 = ½ÇÁ¦ ¼¹ö¿¡ µé¾î°¡ ÀÖ´Â ÆÄÀÏÀúÀå Àå¼Ò (directory Æ÷ÇÔ - /home/test/www/data/test.zip)
*/
$dn = "1"; // 1 ÀÌ¸é ´Ù¿î 0 ÀÌ¸é ºê¶ó¿ìÁ®°¡ ÀνÄÇϸé ȸ鿡 Ãâ·Â
$dn_yn = ($dn) ? "attachment" : "inline";
$bin_txt = "1";
$bin_txt = ($bin_txt) ? "r" : "rb";
$file = $row[sfile1]; # ¼¹ö¿¡ ÀúÀåµÈ ÆÄÀÏ Á¤º¸
$dnfile = $row[file1]; # »ç¿ëÀÚ°¡ ¹Þ¾Æ°¥ ÆÄÀϸí
$file = "aaa.php";
$dnfile = "aaa.php";
if(eregi("(MSIE 5.0|MSIE 5.1|MSIE 5.5|MSIE 6.0)", $HTTP_USER_AGENT)) {
if(strstr($HTTP_USER_AGENT, "MSIE 5.5")) {
header("Content-Type: doesn/matter");
Header("Content-Length: ".(string)(filesize("$file")));
Header("Content-Disposition: filename=$dnfile");
Header("Content-Transfer-Encoding: binary");
Header("Pragma: no-cache");
Header("Expires: 0");
}
if(strstr($HTTP_USER_AGENT, "MSIE 5.0")) {
Header("Content-type: file/unknown");
header("Content-Disposition: attachment; filename=$dnfile");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
if(strstr($HTTP_USER_AGENT, "MSIE 5.1")) {
Header("Content-type: file/unknown");
header("Content-Disposition: attachment; filename=$dnfile");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
if(strstr($HTTP_USER_AGENT, "MSIE 6.0")) {
Header("Content-type: application/x-msdownload");
Header("Content-Length: ".(string)(filesize("$file"))); // À̺κÎÀ» ³Ö¾î ÁÖ¾î¾ßÁö ´Ù¿î·Îµå ÁøÇà »óÅ°¡ Ç¥½Ã
Header("Content-Disposition: attachment; filename=$dnfile");
Header("Content-Transfer-Encoding: binary");
Header("Pragma: no-cache");
Header("Expires: 0");
}
} else {
Header("Content-type: file/unknown");
Header("Content-Length: ".(string)(filesize("$file")));
Header("Content-Disposition: $dn_yn; filename=$dnfile");
Header("Content-Description: PHP3 Generated Data");
Header("Pragma: no-cache");
Header("Expires: 0");
}
if (is_file("$file")) {
$fp = fopen("$file", "rb");
if (!fpassthru($fp)) {
fclose($fp);
}
} else {
echo "ÇØ´ç ÆÄÀÏÀ̳ª °æ·Î°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.";
}
?>
|
|
̵̧ : 686 |
̵̧
¸ñ·Ï
|
|
|  |
|