java用multipartFile接口上传和读取图片及设置上传图片大小

public MultipartConfigElement multipartConfigElement() { MultipartConfigFactory factory = new MultipartConfigFactory(); //单个文件最大 
    factory.setMaxFileSize(DataSize.ofMegabytes(80)); //MB                         
    factory.setMaxFileSize(DataSize.ofKilobytes(80)); //KB     
    factory.setMaxFileSize(DataSize.ofGigabytes(5)); //Gb  设置总上传数据总大小 
    factory.setMaxRequestSize(DataSize.ofKilobytes(100)); //KB 
    factory.setMaxRequestSize(DataSize.ofMegabytes(100)); //MB 
    factory.setMaxRequestSize(DataSize.ofGigabytes(100)); //Gb

你可能感兴趣的:(笔记,java,spring,开发语言,jvm)