Created
August 16, 2016 19:14
-
-
Save m4munib/9e0738d8a44830277f828fd0b139bc5e to your computer and use it in GitHub Desktop.
How to render bytes Image on the fly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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