Respected
I am developing a module in asp.net. Where a user submits a picture using fileupload control to the server. At server i Have to create image of the uploaded file without saving it on server and show it on the webpage in response.
Stream fi = FileUpload1.PostedFile.InputStream;
var ext = FileUpload1.PostedFile.ContentType;
var imageOrNot = ext.Contains("image") ? true : false;
if (imageOrNot)
{
byte[] imagearr = new byte[fi.Length];
fi.Read(imagearr, 0, (int)fi.Length);
fi.Close();
Response.Write(imagearr);
MemoryStream ms = new System.IO.MemoryStream(imagearr);
System.Drawing.Image imgTemp = System.Drawing.Image.FromStream(ms);
To Some Extent I have coded some of the portion but the major portion is to be done