Tomcat: what happens when a HTTP Multipart request gets interrupted?

Viewed 611

From my understanding of this, when the Tomcat server receives a HTTP Multipart request, the servlet will only be invoked after the transfer of all the parts is completed.

What happens if the transfer gets interrupted in the middle? (For example if the network connection of the client drops while uploading a 1Gb file?) When will the servlet be invoked in this case?

To be specific, I can see inside my servlet some not-properly closed java.io.InputStream (from an interrupted transfer probably), but I would expect that the server would reject the Multipart as incomplete even before invoking the servlet? How to explain theses not-properly closed files? The HTTP protocol has some control mechanisms to prevent incomplete requests. (I'm using org.apache.commons.fileupload.FileItem from Apache Commons FileUpload)

My question might not be specific to Java/Tomcat.

1 Answers
Related