Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8748583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:33:00+00:00 2026-06-13T12:33:00+00:00

Fairly straightforward question, I have images stored in my database as varbinary and would

  • 0

Fairly straightforward question, I have images stored in my database as varbinary and would like to provide a link to these images rather than displaying them on the website. When a user clicks the link he/she should be able to download the image.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:33:01+00:00Added an answer on June 13, 2026 at 12:33 pm

    An image is served in response to a request.

    <img src="?" /> <!-- what goes here? -->
    

    You need to create an HTTP handler to receive requests for these images.

    A handler is an executable available at a specific URL which can respond to your request; in this case, by serving the binary data of an image. An ASPX page is a valid handler, though there are more efficient handler types for images.

    <img src="MyHandler.aspx?imageId=123" />
    

    The handler should do a few things:

    • validate that the ID is valid and that the caller has permissions (if needed)
    • retrieve the image from the database
    • set appropriate response headers
    • use Response.BinaryWrite() to send the binar data to the client.

    Note that if you are using ASP.Net MVC, you can use a controller as your handler.

    An alternative method is to base 64 encode the bytes and embed them directly in the image tag.

    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
    AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
    9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">
    

    This is a useful technique for small images or when the expense of multiple requests is very high.

    See: http://en.wikipedia.org/wiki/Data_URI_scheme

    More reading:

    • Dynamically Rendering asp:Image from BLOB entry in ASP.NET
    • Dynamic Image Generation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Fairly straightforward question. I have a map that I wish to initialize by calling
This seems like a fairly straightforward question but I've been unable to find an
This seems like a fairly straightforward question, but I couldn't find this particular use-case
I think this is a fairly straightforward question but I have not been able
I have a fairly straightforward question in Rails 3 to which I can't seem
I have a fairly straightforward question about using droplets for my mac application. My
This is a fairly straightforward question. I have Users in my Rails3 Application. I
Fairly straightforward question here, but I can't seem to find someone who has asked
I have a fairly straightforward Java class here which creates 2 thread pools.... Connects
I have a fairly straightforward WCF service that performs one-way file synchronization for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.