79484034

Date: 2025-03-04 14:52:49
Score: 1
Natty:
Report link

Thanks for the hint about StreamReader being text only....doh!

so creating a memorystream works great.

ms = new MemoryStream(client.DownloadData(baseUrl + endPoint));
Response.Clear();
Response.BufferOutput = true;
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment; filename="report.pdf");
Response.BinaryWrite(ms.ToArray());

Thanks all

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Rolf Herbert