Class MultipartProperties
java.lang.Object
org.springframework.boot.autoconfigure.web.servlet.MultipartProperties
@ConfigurationProperties(prefix="spring.servlet.multipart",
ignoreUnknownFields=false)
public class MultipartProperties
extends Object
Properties to be used in configuring a
MultipartConfigElement
.
location
specifies the directory where uploaded files will be stored. When not specified, a temporary directory will be used.max-file-size
specifies the maximum size permitted for uploaded files. The default is 1MBmax-request-size
specifies the maximum size allowed for multipart/form-data requests. The default is 10MB.file-size-threshold
specifies the size threshold after which files will be written to disk. The default is 0.
These properties are ultimately passed to MultipartConfigFactory
which means
you may specify numeric values using long values or using more readable
DataSize
variants.
- Since:
- 2.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjakarta.servlet.MultipartConfigElement
Create a newMultipartConfigElement
using the properties.boolean
org.springframework.util.unit.DataSize
org.springframework.util.unit.DataSize
org.springframework.util.unit.DataSize
boolean
void
setEnabled
(boolean enabled) void
setFileSizeThreshold
(org.springframework.util.unit.DataSize fileSizeThreshold) void
setLocation
(String location) void
setMaxFileSize
(org.springframework.util.unit.DataSize maxFileSize) void
setMaxRequestSize
(org.springframework.util.unit.DataSize maxRequestSize) void
setResolveLazily
(boolean resolveLazily)
-
Constructor Details
-
MultipartProperties
public MultipartProperties()
-
-
Method Details
-
getEnabled
public boolean getEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
getLocation
-
setLocation
-
getMaxFileSize
public org.springframework.util.unit.DataSize getMaxFileSize() -
setMaxFileSize
public void setMaxFileSize(org.springframework.util.unit.DataSize maxFileSize) -
getMaxRequestSize
public org.springframework.util.unit.DataSize getMaxRequestSize() -
setMaxRequestSize
public void setMaxRequestSize(org.springframework.util.unit.DataSize maxRequestSize) -
getFileSizeThreshold
public org.springframework.util.unit.DataSize getFileSizeThreshold() -
setFileSizeThreshold
public void setFileSizeThreshold(org.springframework.util.unit.DataSize fileSizeThreshold) -
isResolveLazily
public boolean isResolveLazily() -
setResolveLazily
public void setResolveLazily(boolean resolveLazily) -
createMultipartConfig
public jakarta.servlet.MultipartConfigElement createMultipartConfig()Create a newMultipartConfigElement
using the properties.- Returns:
- a new
MultipartConfigElement
configured using there properties
-