Board index » delphi » Still having problems with HTTP Post 8.004b

Still having problems with HTTP Post 8.004b

I am really stuck on this one .... Am I doing something wrong ?? Is there a
better way ?? It worked for a small file so I presumed I was doing
everything correctly.

Is there a limitation on size ???? I looked into the indy source and
pressumed it would be ok .. because it appears to chunk the data ??

All I am doing is .. I have a simple form with a button on with the
following .... (post to an ISAPI dll)

procedure TForm1.Button1Click(Sender: TObject);
var
     tmp_stream1,
     tmp_stream_ret : TMemoryStream;
begin
     tmp_stream1 := TMemoryStream.Create;
     tmp_stream_ret := TMemoryStream.Create;
     tmp_stream1.LoadFromFile('C:\lee\credits.gif'); // sample file name
    Idhttp1.host := '127.0.0.1';
    Idhttp1.port := 80;
    Idhttp1.request.contenttype := 'multipart/form-data';

    IdHTTP1.Post('http://localhost/scripts/discus-online/Test.dll/TestSend',
tmp_stream1, tmp_stream_ret);
    messagedlg(PChar(tmp_stream_ret.Memory), mtinformation, [mbOK], 0);
    tmp_stream_ret.Free;
    tmp_stream1.Free;
end;

If the file loaded is small my simple isapi dll just returns the length ..
however larger files don't even get to the dll .. it excepts before hand.

The isapi code is simply along these lines ...

procedure TWebModule1.WebModule1WebActionTestSendAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
    tmp_string       : string;
    mem_stream       : TMemoryStream;
begin
   Handled := false;
   tmp_string := Request.ContentFields.Values['Param'];
   mem_stream := TMemoryStream.Create;
   Response.Content := 'Count == ' + IntToStr((Request as
TISAPIRequest).ECB.cbTotalBytes) + #13 + #10 + 'TotalBytes == ' +
IntToStr(Request.ContentLength);
   mem_stream.Free;
  Handled := true;
end;

Any help really appreciated !

 

Re:Still having problems with HTTP Post 8.004b


l...@axiomsoftware.com (Lee Collins) wrote in
<8q7pkh$li...@bornews.borland.com>:

If I remember correctly, you mentioned that it was happening wit hIE also?
IF so, it's the server-side. If it is, let me know, you can use a upload
component I have developed and is now part of the DHWeb2000 set to do the
server-side app.

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

Re:Still having problems with HTTP Post 8.004b


Hadi .. cheers for the reply.

I don't think it is the server side.  I am writing a client application to
post the data to an isapi dll ... so am not using a browser.

I have expermimented with other ideas and have managed to post a complete
file of large size to the server and it excepts it ... that was using IE and
html, however I have to do this from a delphi application and cannot use a
browser.

In debug mode it appears to hit problems during the chunking of the file.

Any ideas really appreciated ?? (I will try 8.005b in the meantime)

Hadi Hariri - Team Indy <h...@delphihome.com> wrote in message
news:8FB4BC3A7hadidhcom@207.105.83.62...

Quote
> l...@axiomsoftware.com (Lee Collins) wrote in
> <8q7pkh$li...@bornews.borland.com>:

> If I remember correctly, you mentioned that it was happening wit hIE also?
> IF so, it's the server-side. If it is, let me know, you can use a upload
> component I have developed and is now part of the DHWeb2000 set to do the
> server-side app.

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

Re:Still having problems with HTTP Post 8.004b


l...@axiomsoftware.com (Lee Collins) wrote in
<8qa9p0$h...@bornews.borland.com>:

Quote
>Hadi .. cheers for the reply.

>I don't think it is the server side.  I am writing a client application
>to post the data to an isapi dll ... so am not using a browser.

>I have expermimented with other ideas and have managed to post a
>complete file of large size to the server and it excepts it ... that was
>using IE and html, however I have to do this from a delphi application
>and cannot use a browser.

>In debug mode it appears to hit problems during the chunking of the
>file.

>Any ideas really appreciated ?? (I will try 8.005b in the meantime)

Can you send me the project? Both client and server side? Also what is the
max file you've been able to post?

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

Other Threads