Will Spring hold contents in memory or stores in the disk?

前端 未结 4 797
说谎
说谎 2021-02-07 20:36

When a file say 100 MB size is uploaded from browser will Spring hold whole data in memory or stores in the disk temporarily. After going through Spring doc I know how to set a

4条回答
  •  北荒
    北荒 (楼主)
    2021-02-07 21:26

    In spring boot, spring.servlet.multipart.file-size-threshold specifies the size threshold after which files will be written to disk.

    The default value of the property is zero. It means by default, it stores all files in a temporary location (can be configured via spring.servlet.multipart.location).

    Link: spring boot properties

    Be aware of some bugs on the implementations here: https://github.com/spring-projects/spring-boot/issues/9073

提交回复
热议问题