相信自己!

            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 北極雪 閱讀(258) 評論(0)  編輯  收藏 所屬分類: 網上轉載

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


          網站導航:
           
          主站蜘蛛池模板: 五大连池市| 乌兰察布市| 钟山县| 吉水县| 郯城县| 石屏县| 土默特左旗| 开原市| 宁海县| 西平县| 五家渠市| 鸡东县| 东方市| 石楼县| 饶阳县| 鄂伦春自治旗| 长泰县| 湖州市| 阳曲县| 克拉玛依市| 吴桥县| 金堂县| 安福县| 涞水县| 雷山县| 光泽县| 永德县| 商水县| 神木县| 南岸区| 集安市| 宁明县| 大名县| 鹤山市| 柞水县| 承德县| 长治市| 通州市| 仙游县| 伊春市| 临江市|