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 !