Возврат русского имени файла в ответе HttpResponseMessage

webApi формирует файл и отправляет его следующим способом:

HttpResponseMessage response = this.Request.CreateResponse(HttpStatusCode.OK);
string contenttype = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
response.Content.Headers.ContentType = new MediaTypeHeaderValue(contenttype);
response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
response.Content.Headers.ContentDisposition.FileName = fileName;   
return response;

filename содержит имя файла написанное кириллицей. В результате мне приходит кракозябра вместо имени файла.

attachment;filename="=?utf-8?B?0KPQstC10LTQvtC80LvQtdC90LjQtSDRgSDRgNGD0YHRgdC60LjQvNC4INCx0YPQutCy0LDQvNC4Lnhsc3g=?="

Можно ли как-то отправить имя файла читаемое или надо конвертировать уже на принимающей стороне?


Ответы (0 шт):