Skip to content

Instantly share code, notes, and snippets.

@m4munib
Created August 16, 2016 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m4munib/9e0738d8a44830277f828fd0b139bc5e to your computer and use it in GitHub Desktop.
Save m4munib/9e0738d8a44830277f828fd0b139bc5e to your computer and use it in GitHub Desktop.
How to render bytes Image on the fly
try {
byte[] imageBytes = null;
imageBytes = ...; //read image from the disk
if (imageBytes != null)
{
Response.Clear();
Response.ContentType = "image/jpg";
Response.BinaryWrite(imageBytes);
Response.End();
}
} catch (Exception ex) {
//handle exception
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment