Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Upload function in a thread

 Post Reply Post Reply
Author
Arnaldo Caliari View Drop Down
New Member
New Member
Avatar

Joined: 04 Jul 2017
Posts: 22
Post Options Post Options   Quote Arnaldo Caliari Quote  Post ReplyReply Direct Link To This Post Topic: Upload function in a thread
    Posted: 11 Jul 2017 at 10:38pm
Hi,

for descendents of TTMSFMXCloudStorage, i would like to put the Upload function in a separate thread, and also use the OnProgressUpload event to show something similar to a progress bar to the user. I thought to "Thread.Synchronize" in some way the progress bar update (at this time i don't know precisely how to make it).

I have searched through your code, and i've seen that

procedure TTMSFMXCloudBase.DoUploadProgress(Filename: string; position, total: int64);
begin
  if Assigned(OnUploadProgress) then
    OnUploadProgress(Self,FileName,position,total);
  Application.ProcessMessages;
end;

makes a   "Application.ProcessMessages" call.

So, is right to assume that i can't make the Upload function in a separate thread ? Maybe i can create a derived TTMSFMXCloudStorage class to change the behaviour of the ancestor's DoUploadProgress, to make it "thread safe" ?

Sorry if i'm not so clear, at the moment i'm looking for the best way to approach the problem.

Thanks in advance !!!

Arnaldo



Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2083
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jul 2017 at 9:11am
Hi,

Unfortunately the Upload function is currently not thread safe.
We'll have to investigate if this feature can be added in a future version of the TMS FMX Cloud Pack.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down