JAKARTAPROJECT
JAKARTA TIPJSP TIPJSP Áú¹®&´äº¯DATABASE TIPJAVASCRIPT TIPWEBHACKING TIP±âŸ TIP
ÀÚÄ«¸£Å¸ ÇÁ·ÎÁ§Æ®
ÀÚÄ«¸£Å¸ ÇÁ·ÎÁ§Æ®
ÀÚÄ«¸£Å¸ ÇÁ·ÎÁ§Æ® ÆÁ °Ô½ÃÆÇ ÀÔ´Ï´Ù
Commons-Fileupload ÇѱÛó¸®
¼ö½Ã¾Æ
À̹ÌÁö ½½¶óÀÌ´õ º¸±â

¾È³çÇϼ¼¿ä.. ^^

 

ÆÄÀÏ ¾÷·Îµå ã´Ù°¡ ¿ä±â±îÁö ¿Ô³×¿ä.. ^^

 

»ùÇÃÄÚµå´Â Àß ºÃ½À´Ï´Ù..

(»ùÇÃÄڵ忡 º¯¼öÀ̸§ÀÌ Á¶±Ý À߸ø µÇ¾î ÀÖ´Â ºÎºÐÀÌ ÀÖ¾ú½À´Ï´Ù. - Å«¹®Á¦´Â ¾Æ´ÏÁÒ.. ^^)

 

 

ÆÄÀÏ ¾÷·Îµå¸¦ ±¸ÇöÇϸ鼭 ¾î·Á¿ò(?)À» °Þ¾ú´ø ºÎºÐ°ú ÇØ°á ºÎºÐÀ» Àû¾îº¸·Á ÇÕ´Ï´Ù.

(Àúµµ µµ¿òÀ» ¹Þ¾ÒÀ¸´Ï, Ȥ½Ã³ª Àú¿Í °°Àº ¾î·Á¿ò(?) À» °ÞÀ¸½Å ºÐµéÀ» À§ÇÏ¿©.. ^^)

 

 

 

* OS : Linux
* DB : Oracle
* WAS : OC4J 10g AS

 

        /**
         * form tagÀÇ input nameµéÀÌ ¾Æ·¡¿Í °°ÀÌ ÀÖ½À´Ï´Ù.
         */

        String sMode = "";
       
        String sPageNo = "";
        String sKeyWord = "";
        String sSearchPart = "";
        String sSeqNum = "";
       
        String sAnsTitle = "";
        String sAnsContent = "";
       
        String sFileName = "";
        String sTmpFileName = "";

 

        try {

            //Multipart·Î ³Ñ¾î¿Ô´Â°¡?
            if (FileUpload.isMultipartContent(req)) {
               
                DiskFileUpload dfuUpload = new DiskFileUpload();
               
                /**
                 * ÀÌ ºÎºÐ »ó´çÈ÷ ¾Ö¸¦ ¸Ô¾ú½À´Ï´Ù.
                 * Windows ȯ°æ¿¡¼­´Â ¹®Á¦°¡ ¾ø´Âµ¥,
                 * °³¹ß ¼­¹ö(Linux)·Î ¿Ã¸®°Ô µÇ¸é °è¼ÓÇؼ­ ÇѱÛÀÌ ±úÁö´õ±º¿ä.
                 *
                 * ±×·¡¼­, ¾Æ·¡¿Í °°ÀÌ DiskFileUploadÀÇ HearderEncodingÀ» ÇØÁÖ¾ú½À´Ï´Ù.
                 */

                dfuUpload.setHeaderEncoding("EUC_KR");
               
                List lsItems = dfuUpload.parseRequest(req);
                Iterator iterator = lsItems.iterator();
               

                while (iterator.hasNext()) {

                    FileItem fItem = (FileItem) iterator.next();
                   
                    /**
                     * ³Ñ¾î¿À´Â formÀÌ multipartÀ϶§µµ ÀÖ°í ¾Æ´Ò °æ¿ìµµ À־
                     * ó¸®ÇÑ ºÎºÐÀÔ´Ï´Ù.
                     *
                     * HashMapÀ» »ç¿ëÇؼ­ putÇÑ ´ÙÀ½¿¡, ÇÊ¿äÇÒ¶§ ²¨³» ½áµµ ¹«¹æÇÒµí ÇÕ´Ï´Ù.
                     */

                    if ("mode".equals(fItem.getFieldName())) {
                        sMode = fItem.getString();
                    } else if ("pageNo".equals(fItem.getFieldName())) {
                        sPageNo = fItem.getString();
                    } else if ("keyWord".equals(fItem.getFieldName())) {
                        //ÇѱÛó¸®
                        sKeyWord = fItem.getString("EUC_KR");
                    } else if ("searchPart".equals(fItem.getFieldName())) {
                        sSearchPart = fItem.getString();
                    } else if ("seqNum".equals(fItem.getFieldName())) {
                        sSeqNum = fItem.getString();
                    } else if ("ansTitle".equals(fItem.getFieldName())) {
                        //ÇѱÛó¸®
                        sAnsTitle = fItem.getString("EUC_KR");
                    } else if ("ansContent".equals(fItem.getFieldName())) {
                        //ÇѱÛó¸®
                        sAnsContent = fItem.getString("EUC_KR");
                    }

                    //ÆÄÀÏ Å¸ÀÔ ÆûÇʵå¶ó¸é
                    if (!fItem.isFormField()) {

                        if (fItem.getSize() > 0) {
                            //ÆÄÀÏ À̸§À» °¡Á®¿Â´Ù
                            //- À§¿¡¼­ dfuUpload.setHeaderEncoding("EUC_KR")¸¦ ¾ÈÇØ Áá´õ´Ï

                            //   ÆÄÀÏÀ̸§ÀÌ ÀÚ²Ù ±úÁö´õ±º¿ä.
                            sFileName = fItem.getName().substring(fItem.getName().lastIndexOf("\\") + 1);

                            try {
                                /**
                                 * uploadº¯¼ö´Â servlet¿¡¼­ init ÇÒ¶§ ¾Æ·¡¿Í °°ÀÌ ¼±¾ðÇØ ÁÖ¾ú½À´Ï´Ù.
                                 * upload = config.getServletContext().getRealPath("/upload/suggest/");
                                 */

                                File file = new File(upload + sFileName);
                                fItem.write(file);
                            } catch (IOException e) {
                                System.out.println(e);
                            }
                        }
                    }

                }

            } else {
                //multipart°¡ ¾Æ´Ò¶§ »ç¿ëµÇ´Â parameterµéÀ» °¡Áö°í ¿È

                //WebUtilÀº null Check¸¦ À§ÇÑ utilÀÔ´Ï´Ù. - »©µµ »ó°ü¾ø½À´Ï´Ù.
                sMode = WebUtil.nvl((String) req.getParameter("mode"), "");
                sPageNo = WebUtil.nvl((String) req.getParameter("pageNo"), "");
                sKeyWord = WebUtil.nvl((String) req.getParameter("keyWord"), "");
                sSearchPart = WebUtil.nvl((String) req.getParameter("searchPart"), "");
                sSeqNum = WebUtil.nvl((String) req.getParameter("seqNum"), "");
                sAnsTitle = WebUtil.nvl((String) req.getParameter("ansTitle"), "");
                sAnsContent = WebUtil.nvl((String) req.getParameter("ansContent"), "");

            }
        } catch (Exception e) {
            LogManager.getLogger("error").error(e.toString());
        }
       

2005-03-11 23:50:35
211.51.75.***
¹Ý°©½À´Ï´Ù~
0Á¡ (0¸í)
µ¡±Û 3°³ | ÅÂ±× 3°³ | °ü·Ã±Ûº¸±â
ű×ÀÔ·Â
½±Ç¥(,)±¸ºÐÀ¸·Î Çѹø¿¡ ¿©·¯ ű׸¦ ÀÔ·ÂÇÒ¼ö ÀÖ½À´Ï´Ù
commons (16) uload (1) ½Ã°£ÀÌ Èê·¯¼­ Áö±ÝÀº DiskFileUpload´Â Deprecated µÇ¾ú½À´Ï´Ù. (1)
GoodBug
(0) (0)
ÁÁÀºTIP °¨»çÇÕ´Ï´Ù. º¯¼ö¸í¿¡ Á¤¸» ¿À·ù°¡ ÀÖ¾ú³×¿ä ^^)a
222.109.21.*** 2005-03-12 02:45:19
Áã
(0) (0)
¿À Á¤¸» ´ë´ÜÇÕ´Ï´Ù °¨»ç°¨»ç
211.176.212.*** 2006-03-01 23:35:20
monnom00
(0) (0)
À̰͵µ ÅëÇÏÁö ¾Ê´õ±º¿ä... À½..
210.216.97.*** 2006-06-01 11:57:12
À̸§ ºñ¹Ð¹øÈ£
ÀÚÄ«¸£Å¸ ÇÁ·ÎÁ§Æ®
ÀÚÄ«¸£Å¸ ÇÁ·ÎÁ§Æ® ÆÁ °Ô½ÃÆÇ ÀÔ´Ï´Ù
! ¹øÈ£ Á¦¸ñ ±Û¾´ÀÌ ÀÏÀÚ Á¶È¸
Hierarchy of the Apache Software Foundation GoodBug 2005-10-14 10,814
Jakarta Project °­Á °Ô½ÃÆÇÀÔ´Ï´Ù 8 GoodBug 2005-04-03 11,701
44 Log4J log4j¿¡¼­ e.printStackTrace() ¸Þ½ÃÁö¸¦ log¿¡ ³²±â´Â ¹æ¹ý 1 kaiser 2008-10-22 17,613
43 DBUtils DBUtils¿¡¼­ Clob »ç¿ëÇϱâ 3 1 GoodBug 2007-08-28 10,633
42 Spring Spring ¼³Á¤ ÆÄÀÏ ·Îµù 1 GoodBug 2007-07-16 11,317
41 POI POIÀÇ HSLF¸¦ ÀÌ¿ëÇÏ¿© PowerPoint ¹®¼­¸¦ ÀоÀÚ 2 GoodBug 2007-05-28 14,910
40 POI POIÀÇ HWPF¸¦ ÀÌ¿ëÇÏ¿© MS WORD¹®¼­¸¦ ÀоÀÚ 2 GoodBug 2007-05-28 16,839
39 Validator Validator ¼Ó¼ºµé 1 GoodBug 2007-05-11 10,404
38 dd Commons-Fileupload 1.2 1 2 GoodBug 2007-04-23 15,345
37 Apache Apache2 + Tomcat5.5 + mod_jk 4 ¹ÙÀÌ·¯½ºô¸国 2007-01-29 11,066
36 DBUtils DBUtils¿¡¼­ number ŸÀÔÀÇ Ä÷³ÀÌ intÇüÀ¸·Î ¾È³Ñ¾î¿Ã¶§.. 3 1 GoodBug 2006-06-28 10,755
35 ÈìÈì À§ÇèÇÑ static Logger Çʵå... 2 1 ¼­¿¬¾Æºü 2006-03-16 10,113
34 Installing Tomcat with commons-daemon (jsvc) GoodBug 2006-01-08 9,067
33 commons Commons DbUtils ¸î°¡Áö ¿¹Á¦ 3 2 GoodBug 2005-11-17 15,221
32 commons Jakarta Commons Net ¿¡¼­ FTP »ç¿ë½Ã ¸ñ·ÏÀÌ ¾Èº¸ÀÏ °æ¿ì 2 GoodBug 2005-11-15 21,776
31 listFiles() ¿¡¼­ null À» ¹Ýȯ ÃßÀû.. ½Å¸¸µÎ 2008-11-11 11,866
30 commons ¸ñ·ÏÀÌ ¾Èº¸ÀÏ °æ¿ì ÇØ°á±â Iź 1 2 GoodBug 2005-12-23 15,932
29 POI POI·Î ¿¢¼¿ÆÄÀÏ ÀÐÀ»¶§, Invalid header signature ¿¡·¯ 1 GoodBug 2005-11-12 16,540
28 log4j log4j, JSP¿¡¼­ ¿øÇÏ´Â Appender °ñ¶ó¾²±â 1 GoodBug 2005-11-07 13,894
27 commons Commons-Email~ 7 2 GoodBug 2005-10-13 17,860
copyright 2005-2024 by Unicorn