|
|
|
@ -2,8 +2,6 @@ package com.ruoyi.common.utils.file;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.lang.UUID;
|
|
|
|
|
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import com.ruoyi.common.constant.Constants;
|
|
|
|
import com.ruoyi.common.constant.Constants;
|
|
|
|
@ -84,6 +82,7 @@ public class FileUploadUtils
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
throw new IOException(e.getMessage(), e);
|
|
|
|
throw new IOException(e.getMessage(), e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -139,10 +138,11 @@ public class FileUploadUtils
|
|
|
|
{
|
|
|
|
{
|
|
|
|
desc.getParentFile().mkdirs();
|
|
|
|
desc.getParentFile().mkdirs();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!desc.exists())
|
|
|
|
// 解决undertow文件上传bug,因底层实现不同,无需创建新文件
|
|
|
|
{
|
|
|
|
// if (!desc.exists())
|
|
|
|
desc.createNewFile();
|
|
|
|
// {
|
|
|
|
}
|
|
|
|
// desc.createNewFile();
|
|
|
|
|
|
|
|
// }
|
|
|
|
return desc;
|
|
|
|
return desc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|