Board index » delphi » HELP: Indy post problem, example please?

HELP: Indy post problem, example please?

Hi

I am trying to post some data I have collected to a web page
that will then process that data and upload it into our database
at present the data is stored in a richedit component (using the
lines property)

I am trying to upload the data to our webpage using the
following command where something is of the tstream type

IdHTTP1.Post('myserver\post_test.php',richedit1.lines,something);

this causes an "abstract error"

can anyone help me out with this?

Cheers

Chris Veale

 

Re:HELP: Indy post problem, example please?


Hi Tony.

Thanks for the info, it stops the abstract error I was getting,
though Im still not sure if we are sending any data, the page I
am sending it to has phpinfo hooked into it and I cant see the
posted variable displayed there (as it should be), the content
length is correct so it is sending something correctly?

Any ideas what may be happening?

cheers

Chris Veale

Quote
"Tony Caduto" <tcad...@amsoftwaredesign.com> wrote:
>Something should be a tstringstream, not the base tstream.
>Change it to a tstringstream and it will work.  I just finished program that
>does the same thing.

>(multipart is more difficult)
>var
>response:tstringstream;
>request:tstringlist;
>begin
>     response:=tstringstream.create('');
>     request:=tstringlist.create;
>     try
>            request.values['field1']:='this is a test'; //add a form field
>            try
>            IdHTTP1.Post('addresstocgi',request,response);//response will
>contain the response from the CGI
>            showmessage(response.datastring);
>            except
>                   on e:exception do
>                           showmessage(e.message);
>            end;

>    finally
>           response.free;
>          request.free;
>    end;

>end;

>Tony

>"Chris Veale" <cve...@hortresearch.co.nz> wrote in message
>news:3d8148cd$1@newsgroups.borland.com...

>> Hi

>> I am trying to post some data I have collected to a web page
>> that will then process that data and upload it into our database
>> at present the data is stored in a richedit component (using the
>> lines property)

>> I am trying to upload the data to our webpage using the
>> following command where something is of the tstream type

>> IdHTTP1.Post('myserver\post_test.php',richedit1.lines,something);

>> this causes an "abstract error"

>> can anyone help me out with this?

>> Cheers

>> Chris Veale

Other Threads