0

I have spend lots of time to understand the internal working of a multipart file upload in spring boot. Couldn't get a clear picture on it.

Bit confused about the role of spring boot tmp directory. I have a tmp directory named as /tmp/tomcat.4296537502689403143.8587/work/Tomcat/localhost/ROOT]

I was checked the tmp directory during the file upload, couldn't write anything here.If i delete the folder it will throw multipart error.

Can anyone explain the internal working of a file upload and the role of tmp directory.

arj
  • 887
  • 1
  • 15
  • 37

1 Answers1

0

Spring boot web framework comes with embedded web servers: Tomcat by default. Tomcat creates/uses the tmp directory to store temporary files; including uploaded files, session files, and other files.

That behavior can be changed through configuration. Alternatively, you can also configure spring boot to use a different web server.

https://github.com/spring-projects/spring-boot/blob/70eee612ff2a2b1e58cbcb18a4d46e464895c18a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java

TheRealChx101
  • 1,468
  • 21
  • 38