File name: welboard2/download.wel (1,402 bytes) Text file viewer v1.2
    1 : #!/bin/wel¢Ò
    2 : ¢Ò
    3 : /* file: download.wel¢Ò
    4 : ¢Ò
    5 :    °Ô½ÃÆÇ ÆÄÀÏ ´Ù¿î ÇÁ·Î±×·¥ (author: ¼­±¤Çö)¢Ò
    6 : ¢Ò
    7 :    Copyright (c) 2001/03/25 by Wesoft¢Ò
    8 :    All Rights Reserved.¢Ò
    9 : */¢Ò
   10 : ¢Ò
   11 : timeout(0);¢Ò
   12 : htmlquery("GET");¢Ò
   13 : send_cookie= "NO";¢Ò
   14 : break_on= 0;¢Ò
   15 : if(include("include/board.inc")!=OK) return;¢Ò
   16 : ¢Ò
   17 : no= val(no);¢Ò
   18 : if(no<1)¢Ò
   19 :  {¢Ò
   20 :     MSG1= "ÀÚ·á¹øÈ£ ¿À·ù";¢Ò
   21 :     MSG2= "ÀÚ·á ¹øÈ£°¡ ¾ø°Å³ª À߸øµÇ¾ú½À´Ï´Ù." ~ BACK_BUTTON;¢Ò
   22 :     formdump(message_form);¢Ò
   23 :     return disconnect();¢Ò
   24 :  }¢Ò
   25 : ¢Ò
   26 : qstr= "select attfile,fileseq from " ~ mytable ~ " where selno=" ~ no;¢Ò
   27 : if( (rt=mysql_getrecord(qstr,"")) < 1 )¢Ò
   28 :  {¢Ò
   29 :     if(rt==0)¢Ò
   30 :      {¢Ò
   31 :         MSG1= "ÀÚ·á°¡ ¾ø½À´Ï´Ù!";¢Ò
   32 :         MSG2= no ~ "¹øÀÇ °Ô½Ã¹°ÀÌ »èÁ¦µÇ¾ú°Å³ª ¾ø½À´Ï´Ù!" ~ BACK_BUTTON;¢Ò
   33 :         formdump(message_form);¢Ò
   34 :      }¢Ò
   35 :     return disconnect();¢Ò
   36 :  }¢Ò
   37 : if(attfile!="")¢Ò
   38 :  {¢Ò
   39 :     if(fileseq>0) seq= fileseq ~ "-"; else seq= "";¢Ò
   40 :     download_file= "upload/" ~ db ~ "/" ~ seq ~ attfile; // ÀúÀåµÈ ½ÇÁ¦ ÆÄÀϸí¢Ò
   41 :  }¢Ò
   42 : if(attfile=="" || !fexist(download_file))¢Ò
   43 :  {¢Ò
   44 :     MSG1= "´Ù¿î ·Îµå ¿À·ù";¢Ò
   45 :     MSG2= no ~ "¹ø °Ô½Ã¹°Àº ¾÷·ÎµåµÈ ÆÄÀÏÀÌ ¾ø½À´Ï´Ù!" ~ BACK_BUTTON;¢Ò
   46 :     formdump(message_form);¢Ò
   47 :     return disconnect();¢Ò
   48 :  }¢Ò
   49 : ¢Ò
   50 : qstr= "update " ~ mytable ~ " set downcnt=downcnt+1 where selno=" ~ no;¢Ò
   51 : mysql_query(mysql, qstr); // ´Ù¿î Ƚ¼ö Áõ°¡¢Ò
   52 : ¢Ò
   53 : header("Content-type: application/octet-stream");¢Ò
   54 : header("Content-disposition: filename="~attfile);¢Ò
   55 : header("Pragma: no-cache\nExpires: 0");¢Ò
   56 : fdump(download_file); // ÆÄÀÏ Ãâ·Â¢Ò
   57 : return disconnect();¢Ò
File name: welboard2/download.wel (1,402 bytes) Wesoft Corp. ¨Ï 2001 All rights reserved.