excel下载后文件名称不对

正确写法

java 复制代码
		String headerValue = String.format("attachment; filename=\"%s\";", fileName+ "_" + dateStr + ".xlsx");
		// 这样就可以了
        response.setHeader("content-disposition", headerValue);
        // 或者这样
		response.setHeader("Content-Disposition", headerValue);

错误写法

下面这种写法,下载的 excel 名称会有问题

java 复制代码
response.setHeader("content-disposition", "attachment;filename=" + fileName + "_" + dateStr + ".xlsx");
相关推荐
camellias_2 小时前
【无标题】
java·tomcat
咸鱼2.03 小时前
【java入门到放弃】需要背诵
java·开发语言
椰猫子3 小时前
Java:异常(exception)
java·开发语言
win x4 小时前
Redis 使用~如何在Java中连接使用redis
java·数据库·redis
星晨雪海4 小时前
基于 @Resource 的支付 Service 多实现类完整示例
java·开发语言
阿维的博客日记4 小时前
什么是逃逸分析
java·juc
Ricky_Theseus5 小时前
C++右值引用
java·开发语言·c++
Rick19935 小时前
Java内存参数解析
java·开发语言·jvm
我是大猴子5 小时前
Spring代理类为何依赖注入失效?
java·后端·spring
勿忘,瞬间5 小时前
多线程之进阶修炼
java·开发语言