Hi Guy I am having dificulty trying to convert from HttpContext.Current.Response.OutputStream to a byte[] array
This is my code
- byte[] myBuff = new byte[16384];
- using (var memoryStream = new System.IO.MemoryStream())
- {
- HttpContext.Current.Response.OutputStream.CopyTo(memoryStream);
- myBuff = memoryStream.ToArray();
- }
the HttpContext.Current.Response.OutputStream carries an image contentype="image/GIF"
Any Idea what I'm missing or doing wrong?
TIA

Vinay SinghRank #604 · 4K reputationPosted Mar 21, 2020, 8:44 AM EDT
Jose SaizRank #5,346 · 302 reputationPosted Mar 22, 2020, 12:26 PM EDT