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

A

ATS

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?
 
A

Anthony Jones

ATS said:
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.
 
E

Egbert Nierop \(MVP for IIS\)

ATS said:
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 :)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top