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

前端 未结 4 795
说谎
说谎 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:11

    A bit more digging in the javadoc shows that the default maximum in-memory size is 10240 bytes. From that I'd assume that any upload less than 10kB is held in memory, anything larger will be stored on disk. If you don't specify the disk location, it'll likely use a default (I'd guess it'll use the system default tmp directory).

提交回复
热议问题