赞
踩
java.io.IOException: Malformed input or input contains unmappable characters: /data/upload_file/upload/2020/04/16/测试专用_20240416114011A001.pdf
程序部署到Linux环境下,文件上传报错,这是因为服务器编码问题。
使用命令查看服务器编码,正常应该是utf-8,比如:
[root@localhost ~]# locale LANG=zh_CN.UTF-8 LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" LC_ADDRESS="zh_CN.UTF-8" LC_TELEPHONE="zh_CN.UTF-8" LC_MEASUREMENT="zh_CN.UTF-8" LC_IDENTIFICATION="zh_CN.UTF-8" LC_ALL=
如果编码问题可以使用命令进行修改:
export LC_ALL=zh_CN.UTF-8
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。