MultipartConfig (Servlet 4.0 API Documentation - Apache Tomcat 9.0.118)
Description: declaration: package: javax.servlet.annotation, annotation type: MultipartConfig

# Annotation Type MultipartConfig

@Target(TYPE) @Retention(RUNTIME) public @interface MultipartConfig
This annotation is used to indicate that the `Servlet` on which it is declared expects requests to made using the `multipart/form-data` MIME type.
`Part` components of a given `multipart/form-data` request are retrieved by a Servlet annotated with `MultipartConfig` by calling `HttpServletRequest.getPart(String)` or `HttpServletRequest.getParts()`.
E.g. `@WebServlet("/upload")}`
`@MultipartConfig()` `public class UploadServlet extends HttpServlet ... }`

Since:
  Servlet 3.0

- ## Optional Element Summary

  Optional Elements
  Modifier and Type
  Optional Element
  Description
  `int`
  `fileSizeThreshold`
  `String`
  `location`
  `long`
  `maxFileSize`
  `long`
  `maxRequestSize`

- ## Element Details

  - ### location

    String location
    Returns:
      location in which the Container stores temporary files
    Default:
      `""`

  - ### maxFileSize

    long maxFileSize
    Returns:
      the maximum size allowed for uploaded files (in bytes)
    Default:
      `-1L`

  - ### maxRequestSize

    long maxRequestSize
    Returns:
      the maximum size of the request allowed for `multipart/form-data`
    Default:
      `-1L`

  - ### fileSizeThreshold

    int fileSizeThreshold
    Returns:
      the size threshold at which the file will be written to the disk
    Default:
      `0`