Where do file upload streams get the content from?
file-upload, http, java, tcp, tomcat
Solution
Tomcat stores `Part`s in "X:\some\path\Tomcat 7.0\temp" (/some/path/apache-tomcat-7.0.x/temp) directory.
when a multipart request is parsed, if the size of a single part exceed a threshold, a temporary file is created for that part.
your servlet/jsp will be invoked when transfer of all parts has been completed.
when the request is destroyed all temporary files are deleted as well.
if you are interested in the multipart parse phase, take a look at apache commons-fileupload (specifically `ServletFileUpload.parseRequest()`), tomcat is based on a variant of that
UPDATE
you can configure it as a java arg, ie in windows:
Problem
I have a question regarding file upload, which is more related to how it works rather than a code issue. I looked on the internet, but I couldn't find a proper answer. I have a web application running on tomcat, which handles file uploads (through a servlet). Let's say I want now to upload huge files (> 1 Gb). My understading was that the multipart content of the HTTP request was available in my servlet once the whole file was actually transfered. My question is where the content of the request is actually stored ? When one calls `HttpServletRequest.getParts()` an `InputStream` is available on the `Part` object. However, where is the stream reading from ? Does Tomcat store it somewhere ? I guess this might not be clear enough, so I'll update the post according to your comments, if any. Thanks