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();
- }
-
but I get the following error message "Stream does not support reading."
the HttpContext.Current.Response.OutputStream carries an image contentype="image/GIF"
Any Idea what I'm missing or doing wrong?
TIA