Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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.</p> <p>The custom HttpHandler will serve a particular file extension (e.g. '.file'). This is what needs to be done in IIS:</p> <p>Both IIS Versions</p> <ol> <li>Add to section in in web.config:</li> </ol> <p></p> <p>IIS 6.0</p> <ol> <li><p>Add .file (application/x-zip-compressed) extension as MIME type for the website.</p></li> <li><p>Add Application Extension (Website Properties  Virtual Directory  Configuration  Mappings)</p></li> </ol> <p>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</p> <p>IIS 7.0</p> <ol> <li>Add to section in in web.config:</li> </ol> <p> </p> <ol start="2"> <li><p>Add to section in in web.config:</p> <pre><code> &lt;mimeMap fileExtension=".file" mimeType="application/x-zip-compressed" /&gt; </code></pre></li> </ol> <p>Hope that's enough to get you started.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload