display a image from db
-
Hi .. all i wanna display a image in my page .... im getting it as a byte array from db. the problem is i should not store it any where(neither in the client nor in the server side). i wanna give this image as the source for a server side image tag.
byte[] Img =job.getLogo(Id); location = Server.MapPath("/job/temp/"+company + ".jpg"); FileStream fs=new FileStream( location, FileMode.OpenOrCreate,FileAccess.Write); byte[] buffer = Img; BinaryWriter fileWriter = new BinaryWriter(fs); fileWriter.Write(Img); fs.Close(); //HttpContext.Current.Response.ContentType="image/jpeg"; //MemoryStream strMemory = new MemoryStream(Img,0,Img.Length); //strMemory.BeginWrite(Img,0,Img.Length); Logo.Src =System.Configuration.ConfigurationSettings.AppSettings["tempFolder"]+("/temp/"+company+".jpg"); //Page.Response.OutputStream.Write(Img,0,Img.Length); //Response.End(); //System.Configuration.ConfigurationSettings.AppSettings["tempFolder"]+("/temp/"+company+".jpg");
any ideas??? thanx in advance.. sathy