Commit ae8d41b3 by guojuxing

文件下载工具方法修改:如果文件名称长度太短,自动拼接2个下划线字符

parent 5326b27b
...@@ -136,6 +136,10 @@ public class DownloadUtils { ...@@ -136,6 +136,10 @@ public class DownloadUtils {
DataDownloadUtils.mkDir(new File(tempPath)); DataDownloadUtils.mkDir(new File(tempPath));
File file = new File(tempPath); File file = new File(tempPath);
//初始化数据 //初始化数据
if (fileName.length() < 3) {
//如果长度太短
fileName = fileName + "__";
}
tempFile = File.createTempFile(fileName, ExcelExtensionEnum.getExtensionByCode(excelExtensionCode), file); tempFile = File.createTempFile(fileName, ExcelExtensionEnum.getExtensionByCode(excelExtensionCode), file);
final OutputStream out = new FileOutputStream(tempFile); final OutputStream out = new FileOutputStream(tempFile);
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment