tomcat-dev mailing list archives

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

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 = iter.next();
            part.delete();
        }

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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message