Package jakarta.servlet.annotation
Annotation Type MultipartConfig
@Target(TYPE) @Retention(RUNTIME) public @interface MultipartConfig
Annotation that may be specified on a
Servlet class, indicating that instances of the
Servlet expect requests that conform to the multipart/form-data MIME type.
Servlets annotated with MultipartConfig may retrieve the Part components of a
given multipart/form-data request by calling getPart
or getParts.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description intfileSizeThresholdThe size threshold after which the file will be written to diskStringlocationThe directory location where files will be storedlongmaxFileSizeThe maximum size allowed for uploaded files.longmaxRequestSizeThe maximum size allowed for multipart/form-data requests
-
Element Details
-
location
String locationThe directory location where files will be stored- Returns:
- the directory location where files will be stored
- Default:
- ""
-
maxFileSize
long maxFileSizeThe maximum size allowed for uploaded files.The default is -1L, which means unlimited.
- Returns:
- the maximum size allowed for uploaded files
- Default:
- -1L
-
maxRequestSize
long maxRequestSizeThe maximum size allowed for multipart/form-data requestsThe default is -1L, which means unlimited.
- Returns:
- the maximum size allowed for multipart/form-data requests
- Default:
- -1L
-
fileSizeThreshold
int fileSizeThresholdThe size threshold after which the file will be written to disk- Returns:
- the size threshold after which the file will be written to disk
- Default:
- 0
-