下载文件的文件名出现乱码现象。
错误写法:response.addHeader("Content-Disposition","attachment; filename=/""+ new String(("数据元素简表").getBytes(),"iso8859-1")+ "/"");
正确写法:response.addHeader("Content-Disposition","attachment; filename=/""+ new String(("数据元素简表").getBytes("GB2312"),"iso8859-1")+ "/"") ,本地和linux服务器上都能正常显示下载文件的文件名了。
注意:在把文件名发送给服务器的时候一定不能是中文,要把中文转成iso8859-1或其他非中文的形式。