Board index » delphi » TidHTTPServer, C++ Builder 5.0/Delphi 5.0, and POST...

TidHTTPServer, C++ Builder 5.0/Delphi 5.0, and POST...

I've tried to look through the FAQ's, bugs, newgroups, etc... But, I
couldn't find an answer to my problem.

I am trying to use TidHTTP to POST a file to TidHTTPServer.

My client code is as follows:
sResponseStream  := TStringStream.Create( '' );
fFile:= TMemoryStream.Create;
fFile.LoadFromFile( 'c:\xxx.txt' );
ctlHTTP.Post( '/', fFile, sResponseStream );

But within my server program I cannot determine a way to receive the file
within the HTTPServerCommandGet event.

My client program is in Delphi 5, and my server program is in C++ Builder
5.0, which I'm sure doesn't really matter.

Any help would be greatly appreciated.

Thank you,
Scott

 

Re:TidHTTPServer, C++ Builder 5.0/Delphi 5.0, and POST...


sc...@skmsoftware.com (Scott) wrote in <8rj42h$8...@bornews.borland.com>:

Quote
>I've tried to look through the FAQ's, bugs, newgroups, etc... But, I
>couldn't find an answer to my problem.

>I am trying to use TidHTTP to POST a file to TidHTTPServer.

To POST a file to the server you need a server-side application that
receives the file (i.e. an upload).

--
Hadi Hariri
http://delphi.urusoft.com

Re:TidHTTPServer, C++ Builder 5.0/Delphi 5.0, and POST...


h...@delphihome.com (Hadi Hariri - Team Indy) wrote in <8FC57CE73hadidhcom@
207.105.83.62>:

Quote
>To POST a file to the server you need a server-side application that
>receives the file (i.e. an upload).

Thats for PUT - but we should be able to handle binary post no? Or does not
the POST spec support that?

--
Chad Z. Hower (Kudzu) - Church Hill, TN - Team Indy
      "Programming is an art form that fights back"
Forget the Y2K problem, Lets fix the W2K problem.
http://www.pbe.com/Kudzu/ - Free Delphi/CBuilder components and articles

Re:TidHTTPServer, C++ Builder 5.0/Delphi 5.0, and POST...


While the HTTP 1.1 spec does not specify whether POST or PUT can contain
binary data, it is assumed that they can. POST is commonly used to upload
images, etc... to web servers.

As such the Indy components fail to provide this binary data. Also, if
ParseParams is set to true, and binary data is submitted, then and exception
is thrown within the ParseParams routine of DoExecute.

I have modified the TidHTTPServer.pas unit to add an additional parameter to
the TidRequestInfo structure. This additional parameter is of type
TMemoryStream and is only created if a POST is received.

If someone develops a real fix for this, please let me know, otherwise when
I'm though with my current application I can submit my changes if someone
can instruct me as to the correct method.

Thanks,
Scott

"Kudzu - Team Indy" <chad...@pbe.com> wrote in message
news:8FC58A63Dchadngpbecom@207.105.83.62...

Quote
> h...@delphihome.com (Hadi Hariri - Team Indy) wrote in

<8FC57CE73hadidhcom@
Quote
> 207.105.83.62>:
> >To POST a file to the server you need a server-side application that
> >receives the file (i.e. an upload).

> Thats for PUT - but we should be able to handle binary post no? Or does
not
> the POST spec support that?

> --
> Chad Z. Hower (Kudzu) - Church Hill, TN - Team Indy
>       "Programming is an art form that fights back"
> Forget the Y2K problem, Lets fix the W2K problem.
> http://www.pbe.com/Kudzu/ - Free Delphi/CBuilder components and articles

Re:TidHTTPServer, C++ Builder 5.0/Delphi 5.0, and POST...


Quote
>Thats for PUT - but we should be able to handle binary post no?

That's for POST. With PUT, the server understands the command as such and
just saves teh file to the server (like FTP). For POSTING, being it binary
or text, there must be a server side application that processes the
information somehow.

Other Threads