HOWTO Override ASP's Response output for 2003/IIS.

Discussion in 'ASP General' started by ATS, Jul 14, 2006.

  1. ATS

    ATS Guest

    HOWTO Override ASP's Response output for 2003/IIS.

    Please help,

    I want to have an ASP page write back EVERYTHING to the ASP Response. That
    includes HTTP Headers. I want my ASP to look something like this:

    ==========================================
    <%@ Language=VBScript %>
    <%
    Set objBinaryGen = Server.CreateObject("MyComponents.BinaryGenerator")
    vntPicture = objBinaryGen.MakePicture
    Response.BinaryWrite vntPicture
    %>
    ==========================================

    I got this from the MSDN documentation for BinaryWrite, but the problem is
    that the HTTP Headers are still sent before the buffer that the Response
    object manages is populated from the BinaryWrite.

    Is there a way we can 100% STOP the ASP from sending ANY HTTP headers back
    and instead let something like the BinaryWrite send all the data back?
    ATS, Jul 14, 2006
    #1
    1. Advertising

  2. "ATS" <> wrote in message
    news:...
    > HOWTO Override ASP's Response output for 2003/IIS.
    >
    > Please help,
    >
    > I want to have an ASP page write back EVERYTHING to the ASP Response. That
    > includes HTTP Headers. I want my ASP to look something like this:
    >
    > ==========================================
    > <%@ Language=VBScript %>
    > <%
    > Set objBinaryGen = Server.CreateObject("MyComponents.BinaryGenerator")
    > vntPicture = objBinaryGen.MakePicture
    > Response.BinaryWrite vntPicture
    > %>
    > ==========================================
    >
    > I got this from the MSDN documentation for BinaryWrite, but the problem is
    > that the HTTP Headers are still sent before the buffer that the Response
    > object manages is populated from the BinaryWrite.
    >
    > Is there a way we can 100% STOP the ASP from sending ANY HTTP headers back
    > and instead let something like the BinaryWrite send all the data back?


    If there were it wouldn't be HTTP any more. The protocol has a series of
    headers followed by an entity body. If you're receiving the response with a
    home grown TCP/IP app then just discard all the headers until you're read
    the sequence CrLfCrLf then you'll be at the first byte of your binary
    output.
    Anthony Jones, Jul 15, 2006
    #2
    1. Advertising

  3. "ATS" <> wrote in message
    news:...
    > HOWTO Override ASP's Response output for 2003/IIS.
    >
    > Please help,
    >
    > I want to have an ASP page write back EVERYTHING to the ASP Response. That
    > includes HTTP Headers. I want my ASP to look something like this:
    >
    > ==========================================
    > <%@ Language=VBScript %>
    > <%
    > Set objBinaryGen = Server.CreateObject("MyComponents.BinaryGenerator")
    > vntPicture = objBinaryGen.MakePicture
    > Response.BinaryWrite vntPicture
    > %>
    > ==========================================
    >
    > I got this from the MSDN documentation for BinaryWrite, but the problem is
    > that the HTTP Headers are still sent before the buffer that the Response
    > object manages is populated from the BinaryWrite.
    >
    > Is there a way we can 100% STOP the ASP from sending ANY HTTP headers back
    > and instead let something like the BinaryWrite send all the data back?


    Just FYI. Even images that are fetched through the GET method might return
    headers based on the HTTP clients request. So if the HTTP client uses
    If-Modified-Since or ETAg metatag, IIS responds (if possible) with a unique
    value, that identifies the version of the image or it responses "302 Not
    Modified..."

    The way you are at, is writing an IISAPI filter, that intercepts certain
    requests and responds with a plain binary answer. I'm sure you don't want to
    travel that road, since ISAPI is only for crazy madmen :)
    Egbert Nierop \(MVP for IIS\), Jul 15, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sean

    HttpHandler to override IIS

    Sean, Feb 9, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    4,623
    John Timney \(Microsoft MVP\)
    Feb 9, 2004
  2. Alex D.
    Replies:
    3
    Views:
    2,987
    Alex D.
    Jun 12, 2006
  3. Replies:
    4
    Views:
    2,660
  4. Raj
    Replies:
    2
    Views:
    119
    Aaron Bertrand [MVP]
    Apr 14, 2004
  5. whitedog

    Howto Override Server-Content-Type

    whitedog, Mar 8, 2005, in forum: Javascript
    Replies:
    0
    Views:
    115
    whitedog
    Mar 8, 2005
Loading...

Share This Page