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. Advertisements

  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. Advertisements

  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. Advertisements

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. =?Utf-8?B?RHIuIFBhdWwgQ2Flc2FyIC0gQ291bGxCeXRlIChV

    ASP.NET 1.1 VERSION ON WIN SERVER 2003 SP1 & VS 2003 Arch.

    =?Utf-8?B?RHIuIFBhdWwgQ2Flc2FyIC0gQ291bGxCeXRlIChV, Apr 30, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    741
    Aquila Deus
    Apr 30, 2005
  2. Alex D.
    Replies:
    3
    Views:
    3,158
    Alex D.
    Jun 12, 2006
  3. Replies:
    4
    Views:
    2,885
  4. Guennadi V. Vanine
    Replies:
    0
    Views:
    469
    Guennadi V. Vanine
    Aug 21, 2003
  5. Raj
    Replies:
    2
    Views:
    319
    Aaron Bertrand [MVP]
    Apr 14, 2004
  6. Niall Porter
    Replies:
    5
    Views:
    1,251
    Aaron [SQL Server MVP]
    Nov 30, 2004
  7. lkeerthi

    Windows 2003 with ASP, no response

    lkeerthi, Aug 11, 2005, in forum: ASP General
    Replies:
    5
    Views:
    177
    lkeerthi
    Aug 15, 2005
  8. whitedog

    Howto Override Server-Content-Type

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