response.reset();
String fname = contact_id+".wav";
response.setHeader("content-disposition", "attachment;filename=" + fname);
BufferedOutputStream bos = null;
BufferedInputStream bis = null;
try {
url = "/ivr"+url;
System.out.println("filepath:"+url);
bis = new BufferedInputStream(new FileInputStream(url));
bos = new BufferedOutputStream(response.getOutputStream());
byte[] buff = new byte[2048];
int bytesRead;
while( (bytesRead = bis.read(buff)) > 0) {
bos.write(buff,0,bytesRead);
buff = new byte[2048];
}
} catch(final IOException e) {
e.printStackTrace();
} catch(Exception e) {
e.printStackTrace();
}finally {
if (bis != null)
bis.close();
if (bos != null)
{
bos.flush();
bos.close();
bos=null;
}
}
response.flushBuffer();
最后
以上就是勤恳花卷最近收集整理的关于wav 文件下载(weblogic tomcat 可用)的全部内容,更多相关wav内容请搜索靠谱客的其他文章。
发表评论 取消回复