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

前端 未结 4 1119
情话喂你
情话喂你 2021-02-07 20:43

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:04

    If you don't set the temp directory CommonsMultipartResolver will save temporary files to the servlet container's temporary directory.

    The "file" object in your example doesn't hold the data it similar to a java.io.File reference. You need to get the data with file.getBytes().

提交回复
热议问题