mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	!225 【bug修复】文件上传时出现java.nio.file.FileAlreadyExistsException
Merge pull request !225 from CANYON/master
This commit is contained in:
		@@ -130,14 +130,10 @@ public class FileUploadUtils
 | 
			
		||||
    private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
 | 
			
		||||
    {
 | 
			
		||||
        File desc = new File(uploadDir + File.separator + fileName);
 | 
			
		||||
 | 
			
		||||
        if (!desc.getParentFile().exists())
 | 
			
		||||
        {
 | 
			
		||||
            desc.getParentFile().mkdirs();
 | 
			
		||||
        }
 | 
			
		||||
        if (!desc.exists())
 | 
			
		||||
        {
 | 
			
		||||
            desc.createNewFile();
 | 
			
		||||
        if (!desc.exists()) {
 | 
			
		||||
            if (!desc.getParentFile().exists()) {
 | 
			
		||||
                desc.getParentFile().mkdirs();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user