/home/mjc1/public_html/inc/download.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?
@extract($_REQUEST);
if(
$type == "w_file"){
require 
"../inc/db_connet.php";

    
$u_query "select hit from ware where w_large = '$cat_down'";
    
$u_result mysql_query($u_query);
    
$u_row mysql_fetch_row($u_result);
    
$ref_hit $u_row[0] + 1;
    
    
$u_c_query "update ware set hit ='$ref_hit' where w_large ='$cat_down'";
    
$u_c_query mysql_query($u_c_query);
}
if(
$type == "as"){

        
$now_filename explode("."$filename);
//    echo("<br>".$now_filename[0]."<br>");
    
$newFile explode("_" $now_filename[0]);
            


            
$ch_file "../save_dir/as/".$filename;
            if(
file_exists($ch_file)){
            
//echo("<script> alert('ÆÄÀÏÀÌ µî·Ï y');</script>");
            
}else{ echo("<script> alert('ÆÄÀÏÀÌ µî·Ï µÇÁö ¾Ê¾Ò½À´Ï´Ù..');</script>");}




    
    
    if(
$newFile[1]){
        
        
        
        
$newFilename $newFile[0] . "." $now_filename[1];
        
//echo("<br>".$newFilename."<br>");
        
        
        
$newFile_Name "../save_dir/as/tmp/" $newFilename;


        
$tmpFile "../save_dir/as/" $filename;

        
//echo("<br>".$tmpFile. "    ::::: " . $newFile_Name . "<br>");
        
if(!copy($tmpFile,$newFile_Name)){
            
$msg "filed";
            echo (
"
                <script language='javascript'>
                <!--
                    alert ('
$msg');
                
                //-->
                </script>
            "
);

        
        }
            

            
$filename $newFilename;
            
$path "../save_dir/as/tmp";
            
$delfile $path "/" $filename;
        

    } else {
        
$path "../save_dir/as";
    }

    
//$path = "../save_dir/as";

    




    
}

if(
$type == "etc_store"){
    
$path "../save_dir/m_board/file";
}else if(
$type == "upgrade"){
    if(
$s_type == "file"){
        
$path "../save_dir/upgrade/file";
    }else if(
$s_type == "move"){
        
$path "../save_dir/upgrade/move";
    }else if(
$s_type == "photo"){
        
$path "../save_dir/upgrade/photo";
    }
    
}else if(
$type == "w_file"){
        
//$path = "../file";
        
$path "../download";
}else if(
$type == "w_doc"){
        
$path "../save_dir/doc";
}

$baseusrl "http://www.mijinsoft.co.kr/";



$filename trim($filename);
    
$file "$path/$filename";
    if(
file_exists($file)){}else{ echo("<script> alert('ÆÄÀÏÀÌ µî·Ï µÇÁö ¾Ê¾Ò½À´Ï´Ù..');history.back();</script>");}

    
$file_size filesize($file);
if(
eregi("(MSIE 5.5 | MSIE 6.0)"$HTTP_USER_AGENT)) {
        
header("Content-Type: application/octet-stream");
        
header("Content-Disposition: attachment;filename=$filename");
        
header("Content-Transfer-Encoding: binary");
        
header("Pragma: no-cache");
        
header("Expires: 0");
        
Header("Content-Length: $file_size");
        
Header("---");
    } else {
        
Header("Content-type: file/unknown");
        
Header("Content-Disposition: attachment; filename=$filename");
        
Header("Content-Description: PHP Generated Data");
        
header("Pragma: no-cache");
        
header("Expires: 0");
        
Header("Content-Length:$file_size");

    }
    


if (
is_file($file)) {
        
$fp fopen($file,"r");
        if(!
fpassthru($fp)) {
            
fclose($fp);
        }
    }


if(
$delfile){
    if(!
unlink($delfile)){    }
            
        
}
?>