|
|
@ -4,10 +4,9 @@ import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.nio.file.Paths;
|
|
|
|
import java.nio.file.Paths;
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.exception.file.FileException;
|
|
|
|
|
|
|
|
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.core.exception.file.FileException;
|
|
|
|
import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
|
|
|
|
import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
|
|
|
|
import com.ruoyi.common.core.exception.file.FileSizeLimitExceededException;
|
|
|
|
import com.ruoyi.common.core.exception.file.FileSizeLimitExceededException;
|
|
|
|
import com.ruoyi.common.core.exception.file.InvalidExtensionException;
|
|
|
|
import com.ruoyi.common.core.exception.file.InvalidExtensionException;
|
|
|
@ -48,7 +47,8 @@ public class FileUploadUtils
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
|
|
|
return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (FileException fe){
|
|
|
|
catch (FileException fe)
|
|
|
|
|
|
|
|
{
|
|
|
|
throw new IOException(fe.getDefaultMessage(), fe);
|
|
|
|
throw new IOException(fe.getDefaultMessage(), fe);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
catch (Exception e)
|
|
|
|