Products

Price/Order

Support

Partners

Testimonials

Test Results

About us

Contact
 Any limit in POST size data?
Bottom
 
Total posts: 4
 Author Any limit in POST size data?
Mario Alejandro Montoya C.

18.02.2007 21:42:30
Registered user
A bit related to http://www.realthinclient.com/forum/?cmd=viewtopic&topic_id=69&section_id=9

I have the system running fine in some clients, but in one is necesary post a large XML file.

I check in the client app and all the data is sended. But in the Delphi server I only get a part of it:


<Clientes>

  <Cliente>
...
...
...
  </Cliente>

  <Cliente>

    <Id>124</Id>

    <Codigo>800000946-4</Codigo>

    <Nombre>PROCTER <---THE FILE END HERE

I wonder if exist a limit in how much data a POST can have...
Danijel Tkalcec [RTC]

19.02.2007 02:47:34
Registered user
There is no limit to the size of the data you can send or receive. If your Server-side implementation is as described in the post you are referring to, then it should work for any size of a file. I am using this same implementation to upload RTC SDK packages to the Forum (2 MB).

1) Does your Client send the complete content in one POST request?
2) Are you using "Request.Params.AddText()" to fill in FORM POST data?
3) Do you process the data only if "Request.Completed"?

If you are not sure if the Client is sending the complete content, try writing the raw content (what you get from the "Read" method) to a temporary local file before adding it to "Request.Params.AddText()" and see if the whole content is in that file. If it is, check if all delimiters are in place.

Best Regards,
Danijel Tkalcec
Mario Alejandro Montoya C.

20.02.2007 02:53:58
Registered user
The problem was that a row have:

<name>Name & CO.</name>

and break the split...

I'm working on it.

Thanks for the help (no only this time, but the whole support. At least my customer is impresed because I build a custom web server only for them :) )
Danijel Tkalcec [RTC]

20.02.2007 11:03:58
Registered user
Ok, that explains your problem.

Your data is NOT formatted like FORM PORT data, but instead you receive raw data as content body. By filling that data into "Request.Params", then accessing it as elements, you are suggesting the Params property that your data is formatted using the FORM POST format or the URL Query format. Since there is no delimiter specified in your Request header, the Params property will use the default delimiter, which is "&". And that's what breaks your content apart.

You should directly use the content you get from the Read method, without filling it to the "Request.Params" property, since this is actually what you need. If you are NOT receiving very large files (can your Server keep the whole content in memory?), you can just wait for "Request.Completed" and get the whole content into a string with one "Read" method.

Here is an example OnDataReceived event implementation for a DataProvider which expects the content from the Client to be sent in content body without special formatting (or with formatting which you can handle "manually"):

procedure TMyForm.MyProvDataReceived(Sender:TRtcConnection);
var
  myXMLData:string
begin
with TRtcDataServer(Sender) do
  if Request.Completed then
    begin
    // get the whole content body (your XML)
    // into your local now you have your XML content in myXMLData
    myXMLData:=Read;
    end;
end;

The "Request.Params" property is used only if your content body is specially formatted as set of value=name pairs delimited with "&", or as "FORM POST" (not simple POST, but a POST from a FORM in the Browser), for which the Browser will send a special content delimiter.

Best Regards,
Danijel Tkalcec