RTC Forums
May 04, 2024, 05:45:42 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: DataRequest and RtcInfo  (Read 3678 times)
Pieter
RTC Expired
*
Posts: 17


« on: August 15, 2016, 09:45:26 PM »

Hi Danijel,

I am trying to get the client to send a file to the server along with some information.
The client side looks like this:

------------------------------------------------------------------------------
var
   DataRequest: TRtcDataRequest;
   ServerFile, LocalFile: string;   

procedure ButtonClick
begin
   with DataRequest do
   begin
      Request.Query['file'] := URL_Encode(Utf8Encode(ServerFile));
      Request.Info.asText['file'] := LocalFile;
      Request.Info.asText['value1'] := 'ABC';
      Request.Info.asText['value2'] := '123';
      Post;
      if not WaitForCompletion(False,30,True) then
         CancelRequests;
   end;
end;

procedure BeginRequest
begin
   with TRtcDataClient(Sender) do
   begin
      Request.Method := 'PUT';
      Request.FileName := '/UPLOAD';
      Request.Host := ServerAddr;
      Request.ContentLength := File_Size(Request.Info.asText['file']);
      WriteHeader;
   end;
end;
------------------------------------------------------------------------------

When received on the server (CheckRequest), value1 and value2 are empty.
How can I fix this?

Thank you in advance,
Pieter
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: August 15, 2016, 10:00:43 PM »

The "Info" property on all RTC components is local. It is NEVER sent to the other side.

Best Regards,
Danijel Tkalcec
Logged
Pieter
RTC Expired
*
Posts: 17


« Reply #2 on: August 16, 2016, 11:13:14 AM »

I put the strings in the Request.Agent property and that works.
But if there is a better way please let me know.

Best regards,
Pieter
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: August 16, 2016, 03:05:42 PM »

If you are just starting to use the RTC SDK and are looking for learning material, I strongly recommend THIS FAQ TOPIC.

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.024 seconds with 17 queries.