Scalatra文件下载时中文乱码

可以采用Servlet平台的解决方法进行解决:

Ok(file.get, Map(
          "Content-Type"        -> (file.contentType.getOrElse("application/octet-stream")),
          "Content-Disposition" -> ("attachment; filename=" + new String(file.name.getBytes(), "iso8859-1"))
        ))

 

posted @ 2017-07-28 09:34  yshy  阅读(315)  评论(0编辑  收藏  举报