moxiecode/moxie — pull request #65 by acharcourts (2013-12-24 00:36:14+00:00)
Title: Multipart content type defaults to application/octet-stream

Issue:
When `value.type` is missing, the `Content-Type` header doesn't
get set correctly and is subsequently not parsed correctly
in server software.

Observed:
------moxieboundary1387844484049
Content-Disposition: form-data; name="file"; filename="blob"
Content-Type:

ÿØÿàJFIF ....

Expected:
------moxieboundary1387844484049
Content-Disposition: form-data; name="file"; filename="blob"
Content-Type: application/octet-stream

ÿØÿàJFIF ....

Solution:
`value.type` defaults to `application/octet-stream`

Background:
With ASP.Net WebApi v2 server code - Async handler utilizing
`MultipartFormDataStreamProvider` - the provider throws an exception
when parsing the multipart form data.

This was observed with Plupload 2.0.0, html5 runtime
(Chrome and FF tested) _and_ Plupload must be set to
perform resizing before upload. If Plupload is not asked
to resize, the multipart header is set correctly and
upload is fine.

The error was not tracked down to where it occurs in Plupload.

Server Exception:
The ASP.net MultipartFormDataStreamProvider throws the error:

InvalidOperationException
- Error parsing MIME multipart body part header byte [int] of
data segment System.Byte[]
- at System.Net.Http.Formatting.Parsers.MimeMultipartBodyPartParser