相信自己!

            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)  編輯  收藏 所屬分類: 網上轉載

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


          網站導航:
           
          主站蜘蛛池模板: 肃宁县| 青铜峡市| 彩票| 凌云县| 内江市| 潮安县| 镶黄旗| 贵溪市| 塘沽区| 乌拉特前旗| 松阳县| 垦利县| 沐川县| 满城县| 石楼县| 吉安市| 威海市| 洪湖市| 宿迁市| 贵溪市| 黎城县| 临猗县| 共和县| 旬阳县| 平顶山市| 资溪县| 松原市| 嘉义县| 资兴市| 如东县| 南充市| 芜湖市| 广南县| 新沂市| 资兴市| 沙河市| 辽中县| 华安县| 潜山县| 岳西县| 肇庆市|