1

Closed

MimeMultipartBodyPartParser fails if stream does not end with a CRLF

description

Not sure if the spec requires a CR/LF combination at the end of a multipart stream, but there are many file uploaders out there that do not append a CRLF at the end. The MimeMultipartBodyPartParser fails under this scenario.

The parser should probably be a little more tolerant to handle this edge case.
Closed Aug 21, 2012 at 11:27 PM by HenrikN
While it is technically allowed not to have the CRLF as part of the boundary all the MIME multipart generators we have tries (notably all the major browsers) do generate it. Adding support for this has a surprising effect on the complexity of the parser and so we prefer not to do it at this time.

comments

waitekk wrote Dec 15, 2012 at 9:57 AM

What about Adobe Flex standard FileReference library? http://stackoverflow.com/questions/13770536/asp-net-web-api-unexpected-end-of-mime-multi-part-stream-when-uploading-from-fl

It doesn't add newline characters, so ReadAsMultiPartAsync fails, while working with HTML forms.

That's just terrible.