当前位置:网站首页>minio下载文件乱码或者是一条横线
minio下载文件乱码或者是一条横线
2022-08-03 05:09:00 【飞四海】
项目场景:
minio下载文件乱码或者是一条横线
问题描述
这是因为 环境不匹配造成 Liunx和win都是有区别的所以要根据编码去试试
response.setCharacterEncoding(DictConstant.UTF_8);
String fileName =URLDecoder.decode(files.getFileName(), Charsets.UTF_8);
logger.info("--------------------fileName1:{}",fileName);
String fileName2 =URLDecoder.decode(files.getFileName(), Charsets.ISO_8859_1);
logger.info("--------------------fileName2:{}",fileName2);
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") );
解决方案:
直接挨个编码去decode一下 如果是正常中文,就可以直接用了
边栏推荐
- Build your own web page on raspberry pie (1)
- 【Harmony OS】【ARK UI】ets use startAbility or startAbilityForResult to invoke Ability
- Interface test framework combat (1) | Requests and interface request construction
- C# async and multithreading
- IO process thread -> thread -> day5
- 1060 爱丁顿数 (25 分)
- unity2D横板游戏教程6-敌人AI以及受击动画
- Detailed explanation of MOSN reverse channel
- Windows 安装PostgreSQL
- GIS数据漫谈(五)— 地理坐标系统
猜你喜欢

2022/08/02 学习笔记 (day22) 多线程

GIS数据漫谈(六)— 投影坐标系统

Harmony OS ets ArkUI 】 【 】 the development basic page layout and data connection

三丁基-巯基膦烷「tBuBrettPhos Pd(allyl)」OTf),1798782-17-8

在树莓派上搭建属于自己的网页(2)
![[Harmony OS] [ArkUI] ets development graphics and animation drawing](/img/36/f4c91f794b1321f11a24505d1617fb.png)
[Harmony OS] [ArkUI] ets development graphics and animation drawing

【HMS core】【Ads Kit】Huawei Advertising——Overseas applications are tested in China. Official advertisements cannot be displayed

BIOTIN ALKYNE CAS: 773888-45-2 Price, Supplier

typescript47-函数之间的类型兼容性

shell脚本循环语句
随机推荐
Kotlin-Flow common encapsulation class: the use of StateFlow
【Harmony OS】【ArkUI】ets开发 基础页面布局与数据连接
shell script loop statement
typescript41-class类的私有修饰符
1060 爱丁顿数 (25 分)
Interface test framework combat (1) | Requests and interface request construction
MCM箱模型建模方法及大气O3来源解析
技术分享 | 接口自动化测试中如何对xml 格式做断言验证?
MCM box model modeling method and source analysis of atmospheric O3
typescript44-对象之间的类兼容器
js implements a bind function
探索性测试的概念及方法
typescript39-class类的可见修饰符
Odps temporary query can write SQL, turned out to a named?
Super handy drawing tool is recommended
2022/08/02 学习笔记 (day22) 多线程
IO process thread -> thread -> day5
Interface testing framework combat (3) | JSON request and response assertion
DFS对剪枝的补充
UV 裂解的生物素-PEG2-叠氮|CAS:1192802-98-4生物素接头