Re: Decoding - Parsing POST Data on Indy 9 HttpServer

Giganews Newsgroups
Subject: Re: Decoding - Parsing POST Data on Indy 9 HttpServer
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Wed, 22 Sep 2004

"Mike Myers" <mik…@myacd.com> wrote in message
news:E3D2327F96ADE240mik…@myacd.com...

> procedure HTTPCommandGet(AThread: TIdPeerThread; ARequestInfo:
> TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
> begin
>  ARequestInfo.PostStream.Seek(0, soFromBeginning);
>  Memo.Lines.LoadFromStream(ARequestInfo.PostStream);
> end;

You should not be accessing the Memo directly like that.  The OnCommandGet
event is multi-threaded.  You need to use the thread's Synchronize() method
in order to access the GUI in a thread-safe manner.

> The memo on the Server displays the POST Data exactly as I
> sent it. What I'm looking for now is a component or class to
> access the Fields and FileData in the PostStream.

TIdMultiPartFormDataStream uses MIME to encode the data.  Look at
TIdMessageDecoderMIME to decode the data.

Gambit

Replies

None

In response to

Decoding - Parsing POST Data on Indy 9 HttpServer posted by Mike Myers on Wed, 22 Sep 2004