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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. upload images on server

upload images on server

Scheduled Pinned Locked Moved ASP.NET
databasesysadmin
2 Posts 2 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.
  • J Offline
    J Offline
    Jmshastri
    wrote on last edited by
    #1

    hi everybody. I am storing an image in database. but when i retrieve it from it, i can't find a way to display it in image control of my form. I am using buffer for uploading and downloading images. i am supposed to store that image on hard drive and then apply the path of that image into image control. please tell me if is there any other alternative.

    M 1 Reply Last reply
    0
    • J Jmshastri

      hi everybody. I am storing an image in database. but when i retrieve it from it, i can't find a way to display it in image control of my form. I am using buffer for uploading and downloading images. i am supposed to store that image on hard drive and then apply the path of that image into image control. please tell me if is there any other alternative.

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      This is a good one to Google. There has been a lot written about displaying images in a database on an ASP.NET form - typically the solution will either involve having a dedicated .aspx page that returns the image as a binary stream, or having a custom ASP.NET handler (.ashx) that will retrieve and stream out images. The consuming page would then have something like

      <img src='myImagePage.aspx?imageId=42' />

      to define the image. Creating a dedicated .aspx page for this is probably easier - here's an example: http://www.superdotnet.com/Article.aspx?ArticleID=83[^] Creating an HTTP handler requires a little more understading, but could pay off for you if you're interested in learning about it. Here is a link that describes HTTP handlers and a second that specifically deals with image display: http://www.15seconds.com/issue/020417.htm[^] http://www.c-sharpcorner.com/Code/2003/June/HTTPHandlersForImages.asp[^]

      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