I am using dropzone.js to upload files to Web API 2 service. Reading multipart stream gives garbled Russian characters. For example, when I upload file with name Русское название - Russian characters it gives ????? ?????? - Russian characters.
I'm sure that dropzone.js works fine and it is just a Web API problem.
Here is GetStream method.
public override Stream GetStream(HttpContent parent, HttpContentHeaders headers)
{
// For form data, Content-Disposition header is a requirement
ContentDispositionHeaderValue contentDisposition = headers.ContentDisposition;
if (contentDisposition != null)
{
// We will post process this as form data
_isFormData.Add(String.IsNullOrEmpty(contentDisposition.FileName));
return new MemoryStream();
}
// If no Content-Disposition header was present.
throw new InvalidOperationException(
string.Format("Did not find required '{0}' header field in MIME multipart body part..",
"Content-Disposition"));
}