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 1042163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:27:50+00:00 2026-05-16T15:27:50+00:00

I have a ASP .NET load balanced application (webservice and website). It runs on

  • 0

I have a ASP .NET load balanced application (webservice and website). It runs on SQL server. I need to be able to provide large files for download. However, because of the load balancing situation, the files are stored in the SQL database as opposed to the file system. BITS seems to be the best approach. I have full control of the client. However, i don’t know how to configure BITS to read the file from the database. I know how to write the C# code for that, but i don’t know how to get BITS to hook into it as opposed to reading the file from the file system.

Any ideas?

  • 1 1 Answer
  • 1 View
  • 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-05-16T15:27:50+00:00Added an answer on May 16, 2026 at 3:27 pm

    You can create a custom http handler by implementing System.Web.IHttpHandler. The ProcessRequest(HttpContext context) method is where you will write your file retrieval code from the database. Since BITS operates with range requests you will need to parse the value of context.Request.Headers[“Range”] to get the start and end bytes requested. In the ProcessRequest you can read the binary from the database using the SqlCommand.ExecuteReader(CommandBehavior.SequentialAccess) method and set the resulting binary in context.Response.OutputStream. Remember to call context.Response.Flush() at the end.

    The custom HttpHandler will serve a particular file extension (e.g. ‘.file’). This is what needs to be done in IIS:

    Both IIS Versions

    1. Add to section in in web.config:

    IIS 6.0

    1. Add .file (application/x-zip-compressed) extension as MIME type for the website.

    2. Add Application Extension (Website Properties  Virtual Directory  Configuration  Mappings)

    Extension: .file
    Executable Path(s): %windir%\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll
    %windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll

    IIS 7.0

    1. Add to section in in web.config:
    1. Add to section in in web.config:

          <mimeMap fileExtension=".file" mimeType="application/x-zip-compressed" />
      

    Hope that’s enough to get you started.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET application that is running on two load balanced servers. Everything
We have an application that runs over load balanced server instances, and therefore is
We are having two load balancing server. In that we have hosted a asp.net
I have asp.net mvc 4 web application project on my server in IIS Directory.
We have a load balanced (NLB) ASP.NET web app which sends email. The servers
I have a ASP.net application that is referencing a external assembly that I need
I have an intranet ASP.NET web application in which I need to get the
I have an asp.net application that has various text files it needs to load
We have a website that runs on two load balanced servers. We used the
Suppose I have an ASP.NET application running across several web servers behind a load

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.