相信自己!

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            26 隨筆 :: 3 文章 :: 13 評論 :: 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 北極雪 閱讀(255) 評論(0)  編輯  收藏 所屬分類: 網上轉載

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 阜康市| 龙井市| 涡阳县| 应城市| 磴口县| 韶山市| 西乡县| 武定县| 浪卡子县| 离岛区| 大理市| 中山市| 和林格尔县| 无棣县| 深州市| 甘孜县| 邓州市| 镇沅| 咸宁市| 东乌珠穆沁旗| 河曲县| 崇仁县| 定西市| 固阳县| 日照市| 灵山县| 泾源县| 盐山县| 兴安盟| 阳谷县| 孝昌县| 英山县| 仪陇县| 蒙自县| 新疆| 福海县| 岳普湖县| 卓尼县| 梓潼县| 方城县| 承德市|