¾È±Ô °øºÎ¹æ

ACTIVE SERVER PAGE > ±Û ¼öÁ¤Çϱâ

µî·ÏÀÏ : 2017-07-03 20:16 Á¶È¸¼ö : 52,932

Set Conn=Server.CreateObject("ADODB.Connection")
        Conn.Open("DSN=xxx;UID=xx;PWD=;")

        Set FSO = CreateObject("Scripting.FileSystemObject")  
       
        set UploadForm = Server.CreateObject("SiteGalaxyUpload.Form")


        no       = UploadForm("no")
        file1    = UpLoadForm("file1")
       
        SQL = "SELECT filename1 FROM databank WHERE no = " & no

        Set rs = Server.CreateObject("ADODB.Recordset")
        rs.Open SQL,conn,1


        filename1_b=trim(rs("filename1"))      
       
        if Len(file1) > 0 then 
       
               strFile = "c:/inetpub/wwwroot/" & filename1_b
              
                If (FSO.FileExists(strFile)) Then 
                    FSO.DeleteFile(strFile)
                End If
               

        attach_file = UploadForm("file1").FilePath   
               
        FileName1 = Mid(attach_file, InstrRev(attach_file, "\") + 1)   
        strName = Mid(FileName1, 1, Instr(FileName1, ".") - 1)   
        strExt = Mid(FileName1, Instr(FileName1, ".") + 1)       
        bExist = True   
        strFileName = channel02 & strName & "." & strExt   
        countFileName  = 0
        Do While bExist
          If (FSO.FileExists(strFileName)) Then
               countFileName = countFileName  + 1
                  FileName1 = strName & "_" & countFileName & "." & strExt
                    strFileName =  "c:\inetpub/wwwroot/" & FileName1
                Else 
                    bExist = False
                End If
            Loop
      'response.write strFileName
       UploadForm("file1").SaveAs strFileName
       end if
      
        '--------------------------------------------
        ' ÆÄÀÏ¿¡ °ü·Ã µðºñ ¾÷µ¥ÀÌÆ®
        '--------------------------------------------
              
        if Len(file1) > 0 then         
           SQL = "Update databank set filename1 = '" & filename1 & "'"
           SQL = SQL & " where no = " &no
           Conn.Execute(SQL)
        end if

       
        Response.Redirect "board.asp"
      

  ¸ÕÀú ¼Ò½º¸¦ º¸¿© µå·È½À´Ï´Ù......

  ¼Ò½º¸¦ µû¶ó°¡ º¸¸é ½±°Ô ¾Ë ¼ö ÀÖ´Â ³»¿ëÀ¸·Î µÇ¾î ÀÖ½À´Ï´Ù. ±Û¾²±â ºÎºÐ°ú ´Ù¸¥ºÎºÐÀÌ
  °ÅÀÇ ¾øÀÌ Ã³¸®°¡ µÇ±â ¶§¹®¿¡  ´Ù¸¥ °ÍÀº ³Ñ¾î°¡±â·Î ÇÏ°Ú½À´Ï´Ù....
 
  ·¹ÄÚµå ¹øÈ£(no)¿Í ¾÷µ¥ÀÌÆ® ½Ãų ÆÄÀÏÀ» °¡Á® ¿Ô½À´Ï´Ù. (file1, file2)

   if Len(file1) > 0 then  ¸í·ÉÀº ,,,

  ¸¸¾à file1 À̳ª file2¿¡ ¾Æ¹«°ªµµ µé¾î¿ÀÁö ¾Ê¾Ò´Ù¸é,,,, ¼öÁ¤À» ÇØÁÖ¸é ¾ÈµË´Ï´Ù....
  ¼öÁ¤À» ÇÏ°í ½ÍÀº ÆÄÀÏÀÇ À̸§ÀÌ ¾øÀ»¶©, ó¸®ÇÏÁö ¾Ê½À´Ï´Ù.

  ¸¸¾à ÆÄÀÏÀÌ ÀÖÀ» °æ¿ì,,,(filename1_b) ÇöÀç ·¹Äڵ忡 µé¾î ÀÖ´Â ÆÄÀÏÀÇ À̸§ÀÔ´Ï´Ù.

          strFile = "c:/inetpub/wwwroot/" & filename1_b
              
                If (FSO.FileExists(strFile)) Then 
                    FSO.DeleteFile(strFile)
                End If


   ÀÌ ÆÄÀÏÀ» FSO°´Ã¼¸¦ ÀÌ¿ëÇؼ­ Á¸ÀçÇϴ°¡¸¦ üũ¸¦ ÇÏ°í Á¸ÀçÇÑ´Ù¸é »èÁ¦¸¦ ÇØ ÁÖ¸é µË´Ï´Ù.

   ±×¸®±¸,,, write_ok.asp ÆÄÀÏ¿¡¼­ »ç¿ëÇß´ø ¹æ¹ýÀ¸·Î ÀڷḦ ¼­¹ö¿¡ ÀúÀåÇÏ¸é µË´Ï´Ù.
  
   ÀúÀåÇÑ ÈÄ¿¡´Â

      if Len(file1) > 0 then         
           SQL = "Update databank set filename1 = '" & filename1 & "'"
           SQL = SQL & " where no = " &no
           Conn.Execute(SQL)
      end if

   µ¥ÀÌÅÍ º£À̽ºÀÇ ³»¿ëÀ» ¼öÁ¤ÇØ ÁÖ¸é µË´Ï´Ù.....

   ±×·³,,,, ´õÁ¸ ÇÁ·Î±×·¥ ¸¹ÀÌ ¸¸µå½Ã±æ ¹Ù¶ø´Ï´Ù...
 
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.