Код: Выделить всё
HttpResponseMessage fileResponse = new HttpResponseMessage
{
Content = new ByteArrayContent(report) //here the byte array is >80000 in length
};
fileResponse.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/pdf");
return fileResponse;
Код: Выделить всё
HttpResponseMessage result = null;
using (HttpClient client = new HttpClient(new HttpClientHandler() { UseDefaultCredentials = true }))
{
result = await client.GetAsync(getFileURL);
}
Byte[] bytes = response.Content.ReadAsByteArrayAsync().Result;
Теперь длина байтов составляет всего
Подробнее здесь: https://stackoverflow.com/questions/665 ... osemessage