2013年12月19日

将字符串写入文本并下载该文本

摘要: /** * 字节流,传入的字符串,输出文件;服务器不保存文件,不用指定文件路径 * * @param response * @param count * 传入的字符串 * @param fileName * 要保存的文件名 * @return success or error * @throws Exception */ public static String downStream(HttpServletResponse response, String count, String fileName) throws Exception { String msg = null; try { ServletOutputStream ou = response.getOutputStream(); // 下载文件 byte bb[] = count.getBytes();//获取内容的字节 // ByteArrayInputStr 阅读全文

posted @ 2013-12-19 12:34 qgc 阅读(525) 评论(0) 推荐(0)

导航