类 MultipartConfig

java.lang.Object
cn.taketoday.web.multipart.MultipartConfig

public class MultipartConfig 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 512MB
  • max-request-size specifies the maximum size allowed for multipart/form-data requests. The default is 1GB.
  • 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 cn.taketoday.framework.web.servlet.MultipartConfigFactory which means you may specify numeric values using long values or using more readable DataSize variants.

从以下版本开始:
2019-07-11 22:47
作者:
Harry Yang
  • 字段详细资料

    • location

      @Nullable private String location
      temp file upload location
    • maxFileSize

      @Nullable private cn.taketoday.util.DataSize maxFileSize
      Maximum size of a single uploaded file.
    • maxRequestSize

      @Nullable private cn.taketoday.util.DataSize maxRequestSize
    • fileSizeThreshold

      @Nullable private cn.taketoday.util.DataSize fileSizeThreshold
  • 构造器详细资料

    • MultipartConfig

      public MultipartConfig()
  • 方法详细资料

    • setFileSizeThreshold

      public void setFileSizeThreshold(@Nullable cn.taketoday.util.DataSize fileSizeThreshold)
      Sets the size threshold after which files will be written to disk.
      参数:
      fileSizeThreshold - the file size threshold
    • setLocation

      public void setLocation(@Nullable String location)
      Sets the directory location where files will be stored.
      参数:
      location - the location
    • setMaxFileSize

      public void setMaxFileSize(@Nullable cn.taketoday.util.DataSize maxFileSize)
      Sets the maximum size allowed for uploaded files.
      参数:
      maxFileSize - the maximum file size
    • setMaxRequestSize

      public void setMaxRequestSize(@Nullable cn.taketoday.util.DataSize maxRequestSize)
      Sets the maximum DataSize allowed for multipart/form-data requests.
      参数:
      maxRequestSize - the maximum request size
    • getLocation

      @Nullable public String getLocation()
    • getMaxRequestSize

      @Nullable public cn.taketoday.util.DataSize getMaxRequestSize()
    • getMaxFileSize

      @Nullable public cn.taketoday.util.DataSize getMaxFileSize()
    • getFileSizeThreshold

      @Nullable public cn.taketoday.util.DataSize getFileSizeThreshold()
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object