下载

来源:互联网 发布:印度军事实力知乎 编辑:程序博客网 时间:2024/04/17 02:00



 public void downLoad(HttpServletRequest request,

            HttpServletResponse response) throws ServletException, IOException {

        response.setContentType("audio/wav");

 

 

        File file = new File(path);

        String filename = file.getName();

 

        String encodeString = null;

        try {

            filename = new String(filename.getBytes(response.getCharacterEncoding()), request.getCharacterEncoding());

            encodeString = URLEncoder.encode(filename, "utf-8");

        } catch (Exception e) {

            logger.error(e, e);

        }

        response.setHeader("Content-dihttp://www.zhihu.com/people/cpjay


 public void downLoad(HttpServletRequest request,

            HttpServletResponse response) throws ServletException, IOException {

        response.setContentType("audio/wav");

 

 

        File file = new File(path);

        String filename = file.getName();

 

        String encodeString = null;

        try {

            filename = new String(filename.getBytes(response.getCharacterEncoding()), request.getCharacterEncoding());

            encodeString = URLEncoder.encode(filename, "utf-8");

        } catch (Exception e) {

            logger.error(e, e);

        }

        response.setHeader("Content-dihttp://www.zhihu.com/people/cpjay

原创粉丝点击