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 閱讀(142) 評論(0)  編輯  收藏

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


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

          常用鏈接

          留言簿(1)

          隨筆檔案(35)

          文章分類(5)

          文章檔案(2)

          新聞檔案(5)

          java link

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 清苑县| 乌兰浩特市| 东平县| 鹿泉市| 工布江达县| 松溪县| 灵璧县| 加查县| 达拉特旗| 秭归县| 金昌市| 巴楚县| 鲁山县| 项城市| 桐城市| 东光县| 门头沟区| 扎囊县| 涞源县| 类乌齐县| 蒙自县| 黔东| 武冈市| 蕉岭县| 阿拉善左旗| 贺州市| 天镇县| 丹棱县| 兴化市| 黔江区| 灵寿县| 德安县| 汶川县| 岚皋县| 彰武县| 虹口区| 淮安市| 微山县| 蓬安县| 泸定县| 龙山县|