Re: EPrivilege exception trying to access Response.ContentStream

Giganews Newsgroups
Subject: Re: EPrivilege exception trying to access Response.ContentStream
Posted by:  Remy Lebeau (TeamB) (gambit47.no.spam@no.spam.yahoo.com)
Date: Wed, 5 May 2004

"Warren Sirota" <wsiro…@worldwidewoodshed.com> wrote in message
news:E8C2971B0F9CE240wsiro…@worldwidewoodshed.com...

>    if frmmain.IdHTTP1.Response.ContentStream <> nil then
>    begin
>      sz:= frmmain.IdHTTP1.Response.ContentStream.Size ;

You should be passing your own stream to Get() itself and then simply use
the stream after Get() returns, ie:

    Strm := TMemoryStream.Create;
    try
        IdHTTP1.Get(TheURL, Strm);
        // use Strm as needed...
    finally
        Strm.Free;
    end;

Gambit

Replies

In response to

EPrivilege exception trying to access Response.ContentStream posted by Warren Sirota on Wed, 5 May 2004