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) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          <2007年4月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(1)

          隨筆檔案(35)

          文章分類(5)

          文章檔案(2)

          新聞檔案(5)

          java link

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 吉木萨尔县| 寻甸| 苏尼特右旗| 兴安盟| 台南市| 河北省| 贵定县| 青州市| 岑巩县| 邵阳市| 团风县| 城固县| 宜宾县| 光山县| 怀化市| 仁化县| 邳州市| 台江县| 六盘水市| 闽侯县| 武威市| 临湘市| 梨树县| 吐鲁番市| 彭泽县| 若羌县| 咸宁市| 毕节市| 赤城县| 苍南县| 香河县| 淮北市| 张家界市| 兰州市| 吐鲁番市| 巴里| 五华县| 建水县| 西充县| 醴陵市| 内江市|