相信自己!

            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            26 隨筆 :: 3 文章 :: 13 評(píng)論 :: 0 Trackbacks
          <%@ page contentType="text/html;charset=gb2312" %> <%@ page language=" java" import="com.jspsmart.upload.*"%>

          jspSmartUpload : Sample 3


          <% // Variables int count=0; // Initialization mySmartUpload.initialize(pageContext); // Only allow txt or htm files //mySmartUpload.setAllowedFilesList("htm,html,txt,,"); // DeniedFilesList can also be used : // mySmartUpload.setDeniedFilesList("exe,bat,jsp"); // Deny physical path // mySmartUpload.setDenyPhysicalPath(true); // Only allow files smaller than 50000 bytes // mySmartUpload.setMaxFileSize(50000); // Deny upload if the total fila size is greater than 200000 bytes // mySmartUpload.setTotalMaxFileSize(200000); // Upload mySmartUpload.upload(); // Save the files with their original names in a virtual path of the web server try { count = mySmartUpload.save("/pic/upload/news", mySmartUpload.SAVE_VIRTUAL); String title=mySmartUpload.getRequest().getParameter("title"); String content=mySmartUpload.getRequest().getParameter("content"); String picture=mySmartUpload.getFiles().getFile(0).getFileName(); inewBean.insert_news(title,content,picture); } catch (Exception e){ out.println("Wrong selection : " + e.toString()); } // Display the number of files uploaded out.println(count + " file(s) uploaded."); %>
          posted on 2007-12-05 13:12 北極雪 閱讀(258) 評(píng)論(0)  編輯  收藏 所屬分類: 網(wǎng)上轉(zhuǎn)載

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 南江县| 武宁县| 铜山县| 清流县| 应城市| 葫芦岛市| 永嘉县| 阜城县| 嵊州市| 托克逊县| 拉孜县| 潮安县| 桦甸市| 天气| 蓝田县| 广西| 奇台县| 观塘区| 班玛县| 应用必备| 兴海县| 鹤山市| 淅川县| 永春县| 木里| 宜君县| 昌邑市| 句容市| 措勤县| 广德县| 临桂县| 南京市| 松溪县| 沙田区| 镇平县| 饶平县| 察隅县| 萨嘎县| 延庆县| 大名县| 保德县|