posts - 35,  comments - 6,  trackbacks - 0
          if (actflag.equals("download")) {
              saDoc= this.getDocumentAddService().execute(parentCode);
              
              OutputStream out = servletResponse.getOutputStream();
              String name = saDoc.getDocumentName();
              String nameISO = new String(name.getBytes("gb2312"), "iso-8859-1");
              // http       + nameISO + "\"");
              servletResponse.setHeader("Content-Length", String.valueOf(saDoc.getDocumentSize()));
              //BLOB blob = (BLOB) domain.getInformationContent();
              //InputStream in = blob.getBinaryStream();
              
              String path=saDoc.getDocumentSrc();
              path= path.replace('/','\\');
                 String url=servletRequest.getRealPath("
          \\")+path+"\\"+saDoc.getDocumentName();  
              File file=new File(url);
              InputStream in =new FileInputStream(file);
              int count = 0;
              try {
               byte[] data = new byte[8192];
               while ((count = in.read(data)) != -1) {
                out.write(data, 0, count);
               }
              } finally {
               if (in != null) {
                in.close();
               }
               if (out != null) {
                out.close();
               }
              }    
              
              return null;
          posted on 2007-04-17 13:46 NG 閱讀(141) 評論(0)  編輯  收藏

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


          網站導航:
           
          <2007年4月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(1)

          隨筆檔案(35)

          文章分類(5)

          文章檔案(2)

          新聞檔案(5)

          java link

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 黑河市| 牡丹江市| 山丹县| 大新县| 晋城| 大姚县| 永定县| 黑龙江省| 喜德县| 赣州市| 洛宁县| 金阳县| 德钦县| 子洲县| 日喀则市| 马边| 叶城县| 昌宁县| 晴隆县| 临澧县| 崇州市| 确山县| 靖安县| 清原| 聂拉木县| 马山县| 泗洪县| 油尖旺区| 桂东县| 辽宁省| 基隆市| 莒南县| 鄂伦春自治旗| 浮梁县| 墨竹工卡县| 界首市| 石门县| 德钦县| 合作市| 顺义区| 泽州县|