Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. display a image from db

display a image from db

Scheduled Pinned Locked Moved C#
databasesysadmindata-structureshelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    imsathy
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups