G
Guest
I am trying to BinaryWrite an image from a binary string that I am storing in the web.config file. The image is just a 1x1 pixel gif. I am setting the content type to "image/gif", but the output is just my string. Any suggestions? Code is below
byte[] bytes = Encoding.UTF8.GetBytes(ConfigurationSettings.AppSettings["PixelBinaryData"].ToString())
httpContext.Response.ContentType = "image/gif";
httpContext.Response.BinaryWrite(bytes)
byte[] bytes = Encoding.UTF8.GetBytes(ConfigurationSettings.AppSettings["PixelBinaryData"].ToString())
httpContext.Response.ContentType = "image/gif";
httpContext.Response.BinaryWrite(bytes)