当前位置:网站首页>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一下 如果是正常中文,就可以直接用了
边栏推荐
猜你喜欢
WinForm的控件二次开发
修饰生物素DIAZO-生物素-PEG3-DBCO|重氮-生物素-三聚乙二醇-二苯基环辛炔
2. 两数相加
接口测试实战| GET/POST 请求区别详解
BIOTIN ALKYNE CAS:773888-45-2价格,供应商
Talking about GIS Data (5) - Geographic Coordinate System
Where is the value of testers
Shell conditional statement judgment
js implements a bind function
【 Harmony OS 】 【 ano UI 】 lightweight data storage
随机推荐
反射注解基础
User password verification
Modified BiotinDIAZO-Biotin-PEG3-DBCO|diazo-biotin-tripolyethylene glycol-diphenylcyclooctyne
IO进程线程->线程->day5
2. 两数相加
Interface test framework combat (1) | Requests and interface request construction
Installation of Apache DolphinScheduler version 2.0.5 distributed cluster
Interface Test Framework Practice (4) | Get Schema Assertion
IO process thread -> thread -> day5
1095 解码PAT准考证 (25 分)(C语言)
1059 C语言竞赛 (20 分)(C语言)
【Harmony OS】【ArkUI】ets开发 图形与动画绘制
2022/08/02 学习笔记 (day22) 多线程
[Harmony OS] [ArkUI] ets development graphics and animation drawing
1054 求平均值 (20 分)
Presto installation and deployment tutorial
Common lipophilic cell membrane dyes DiO, Dil, DiR, Did spectrograms and experimental procedures
Exception (abnormal) and Error (error) difference analysis
13.
lt.647. Palindromic substring + lt.516. Longest palindrome subsequence Secondary development of WinForm controls