Board index » delphi » Capturing Content Stream from GET

Capturing Content Stream from GET


2007-05-30 02:33:29 AM
delphi203
I have a basic test ISAPI DLL
I am trying to send a Get to my custom http server which in returns sends
back a report (DOC)
I am trying to capture the returned content stream and either show it in a
new window or in a Intraweb control of my current window.
The returned report (doc) needs to go in either a New Window, or Intraweb
control - Because it cannot replace my DLL. The DLL must stay loaded in its
current state.
My Test ISAPI DLL is very simple consisting of a TIWButton (ButtonType =
btSubmit) and some parameters stored in the form's hiddenfields property.
The forms HiddenFields property consists of the parameters i need to get the
report.
Clicking the button will retrieve the report, but the report ends up
replacing my dll.
How can i keep my DLL loaded and have the report go to a Intraweb control or
a new window.
I really would like it to go to a new window, but if thats not possible,
then I'd like to have it go to a new form in my Test ISAPI DLL.
Thanks
Shane
 
 

Re:Capturing Content Stream from GET

Sorry, not GET.... i meant POST
"Shane Holmes" <holmesshanea @ yahoo . com>writes
Quote
I have a basic test ISAPI DLL

I am trying to send a Get to my custom http server which in returns sends
back a report (DOC)

I am trying to capture the returned content stream and either show it in a
new window or in a Intraweb control of my current window.

The returned report (doc) needs to go in either a New Window, or Intraweb
control - Because it cannot replace my DLL. The DLL must stay loaded in
its current state.


My Test ISAPI DLL is very simple consisting of a TIWButton (ButtonType =
btSubmit) and some parameters stored in the form's hiddenfields property.
The forms HiddenFields property consists of the parameters i need to get
the report.

Clicking the button will retrieve the report, but the report ends up
replacing my dll.

How can i keep my DLL loaded and have the report go to a Intraweb control
or a new window.

I really would like it to go to a new window, but if thats not possible,
then I'd like to have it go to a new form in my Test ISAPI DLL.

Thanks

Shane

 

Re:Capturing Content Stream from GET

I can use the idHTTP control to send a post and then check the ContentType
to confirm it is
application/msword
I can also check the size of the stream (it seems to be appropriate).
How can I now take the stream and place it in a new control, form, or window
(without making my DLL go away)?
procedure TIWForm1.IWButton2Click(Sender: TObject);
Var
aStream: TMemoryStream;
Params: TStringList;
begin
aStream := TMemoryStream.create;
Params := TStringList.Create;
try
with IdHTTP1 do
begin
Params.Add('posttype=Logon');
Params.Add('mypagetype=mylogon');
Params.Add('AccountUsername=tony');
Params.Add('AccountPassword=tony');
Params.Add('reportlistbox=XRealtime aem - no params');
Request.ContentType := 'application/x-www-form-urlencoded';
try
Post('http://localhost/', Params, aStream);
except
on E: Exception do
WebApplication.showmessage('Error encountered during POST: ' +
E.Message);
end;
end;
except
end;
WebApplication.ShowMessage(IdHTTP1.Response.ContentType);
//application/msword
aStream.Free;
Params.Free;
end;
"Shane Holmes" <holmesshanea @ yahoo . com>writes
Quote
Sorry, not GET.... i meant POST

"Shane Holmes" <holmesshanea @ yahoo . com>writes
news:XXXX@XXXXX.COM...
>I have a basic test ISAPI DLL
>
>I am trying to send a Get to my custom http server which in returns sends
>back a report (DOC)
>
>I am trying to capture the returned content stream and either show it in
>a new window or in a Intraweb control of my current window.
>
>The returned report (doc) needs to go in either a New Window, or Intraweb
>control - Because it cannot replace my DLL. The DLL must stay loaded in
>its current state.
>
>
>My Test ISAPI DLL is very simple consisting of a TIWButton (ButtonType =
>btSubmit) and some parameters stored in the form's hiddenfields property.
>The forms HiddenFields property consists of the parameters i need to get
>the report.
>
>Clicking the button will retrieve the report, but the report ends up
>replacing my dll.
>
>How can i keep my DLL loaded and have the report go to a Intraweb control
>or a new window.
>
>I really would like it to go to a new window, but if thats not possible,
>then I'd like to have it go to a new form in my Test ISAPI DLL.
>
>Thanks
>
>Shane
>