Example usage for org.springframework.web.multipart.commons CommonsMultipartResolver setMaxInMemorySize

List of usage examples for org.springframework.web.multipart.commons CommonsMultipartResolver setMaxInMemorySize

Introduction

In this page you can find the example usage for org.springframework.web.multipart.commons CommonsMultipartResolver setMaxInMemorySize.

Prototype

public void setMaxInMemorySize(int maxInMemorySize) 

Source Link

Document

Set the maximum allowed size (in bytes) before uploads are written to disk.

Usage

From source file:com.pavikumbhar.javaheart.springconfiguration.WebAppConfig.java

@Bean(name = "multipartResolver")
public CommonsMultipartResolver getCommonsMultipartResolver() {
    CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
    multipartResolver.setMaxUploadSize(20971520); // 20MB
    multipartResolver.setMaxInMemorySize(1048576); // 1MB
    return multipartResolver;
}