tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <>
Subject Shouldn't Servlet 3.0 file upload delete temporary files after request completes
Date Wed, 27 Jun 2012 16:19:40 GMT

I was experimenting with Servlet 3.0 file upload. What seems odd is
that after request is processed the uploaded files are still present
in the work directory of the web application.

The only way to reliably delete those files is what HTMLManagerServlet
does, like

        Iterator<Part> iter = parts.iterator();
        while (iter.hasNext()) {
            Part part =;

but when I use simpler code like  request.getPart("file"); to directly
access the field that I need  it feels odd that I need to explicitly
iterate over parts to perform the cleanup.

Best regards,
Konstantin Kolinko

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message