我是靠谱客的博主 勤恳花卷,这篇文章主要介绍wav 文件下载(weblogic tomcat 可用),现在分享给大家,希望可以做个参考。

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(72)

评论列表共有 0 条评论

立即
投稿
返回
顶部