下载
来源:互联网 发布:淘宝商品关键词 编辑:程序博客网 时间:2024/04/30 02:00
/**
* 下载电话录音
* @param phoneNum
* @return
* @throws IOException
* @throws MalformedURLException
*/
@RequestMapping(value="/downPhoneMp3")
public void downPhoneMp3(HttpServletRequest req, HttpServletResponse resp){
///电话记录id 客户id
JkCustomer jc = (JkCustomer)req.getSession().getAttribute("jcUser");
JkCallRecord jcr = ProInfoService.findCallRecord(Long.parseLong(req.getParameter("callId")));
String recordFile=jcr.getRecordFile().split("password")[0];//电话记录对象
String URL = PropertiesUtils.getString("400RECORDFILE", "")+recordFile.split("voices/record/")[1]+"password="+MD5.getMd5Str(jc.getPhonePassword()+DateUtils.fmtDateToStr(new Date(),"yyyy-MM-dd"));
try {
InputStream is=new URL(URL).openConnection().getInputStream(); //创建连接、输入流
byte[] buffer = new byte[is.available()];
is.read(buffer);
is.close();
resp.reset();//清空response
String exportName = new String((jcr.getId()+"-六健康电话咨询记录.mp3").getBytes("GBK"), "ISO8859_1");
resp.setCharacterEncoding("utf-8");
resp.setHeader("Content-disposition", "attachment;filename="+exportName);
OutputStream toClient = new BufferedOutputStream(resp.getOutputStream());
resp.setContentType("audio/mp3");
toClient.write(buffer);
toClient.flush();
toClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
* 下载电话录音
* @param phoneNum
* @return
* @throws IOException
* @throws MalformedURLException
*/
@RequestMapping(value="/downPhoneMp3")
public void downPhoneMp3(HttpServletRequest req, HttpServletResponse resp){
///电话记录id 客户id
JkCustomer jc = (JkCustomer)req.getSession().getAttribute("jcUser");
JkCallRecord jcr = ProInfoService.findCallRecord(Long.parseLong(req.getParameter("callId")));
String recordFile=jcr.getRecordFile().split("password")[0];//电话记录对象
String URL = PropertiesUtils.getString("400RECORDFILE", "")+recordFile.split("voices/record/")[1]+"password="+MD5.getMd5Str(jc.getPhonePassword()+DateUtils.fmtDateToStr(new Date(),"yyyy-MM-dd"));
try {
InputStream is=new URL(URL).openConnection().getInputStream(); //创建连接、输入流
byte[] buffer = new byte[is.available()];
is.read(buffer);
is.close();
resp.reset();//清空response
String exportName = new String((jcr.getId()+"-六健康电话咨询记录.mp3").getBytes("GBK"), "ISO8859_1");
resp.setCharacterEncoding("utf-8");
resp.setHeader("Content-disposition", "attachment;filename="+exportName);
OutputStream toClient = new BufferedOutputStream(resp.getOutputStream());
resp.setContentType("audio/mp3");
toClient.write(buffer);
toClient.flush();
toClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
0 0
- 下载
- 下载
- 下载
- 下载
- 下载???
- 下载
- 下载
- 下载
- 下载
- 下载
- 下载
- 下载
- 下载
- 下载
- 下载
- 下载
- 下载
- 下载
- Debian/Ubuntu Linux下内核编程者必备
- Radclient的文档
- 实现Windows下的右键菜单添加
- Eclipse配置C/C++开发环境
- sun.misc.BASE64Encoder找不到jar包的解决方法
- 下载
- C指针原理(57)-Ncurses-文本终端的图形
- php将html实体转换成字符窜
- CSDN报数游戏
- c++文件读取
- POJ 3415 Common Substrings
- 村庄现场分红1300余万现金。
- iOS5自带解析类NSJSONSerialization解析json
- android开关机源码