users@servlet-spec.java.net

[servlet-spec users] Servlet API 3.1: multipart/form-data

From: Matti Aarnio <matti.aarnio_at_methics.fi>
Date: Wed, 01 May 2013 18:40:53 +0300

Hello,

The original MIME specification constructed the multipart/* as general framework for delivering data attachments along with the primary contents. There is also definition for few specific usages, like multipart/related, and multipart/alternate.

Current ServletAPI 3.0 and preview of 3.1 are effectively stating around chapter 3.2: "File Upload" that there shall be only support for "multipart/form-data".
The description of @MultipartConfig (chapter 8.1.5) does speak of "mime/multipart" which is not quite same thing as what chapter 3.2 speaks of, nor exactly what MIME specification said -- better phrase would be "MIME multipart"

I use old protocols that could use a bit more relaxed implementation of what "multipart/" is.
My particular example is using "multipart/related".

That specification wording of chapter 3.2 (maybe it was intended as an example?) has resulted a strict compliance implementation at Tomcat 7, and this very nice servlet request processing mechanism in there is practically useless for me.

Really proper specification would support both "message/" and "multipart/" structures allowing efficient iterative stream processing at the servlet. And for that matter, also support encoding mode "chunked" in parts, which my current processing hack using JavaMail does not support.

Best Regards, Matti Aarnio