Best way to upload a lot of files

Hello,

what is the best way to upload 1000-2000 files to a folder in Dropbox/OneDrive/GoogleDrive.
I ask, because on Android and iOS with the following code the app will be closed automatically after 600-700 files. Is there a limitation on the Android/iOS?

FilesToLoad is a TStringList with the filenames of local files. The routine starts with Upload_Files(-1);

procedure Tform1.Upload_Files(i: integer);
begin
  inc(i);

  If i > FilesToLoad.Count-1 then
  begin
      Upload_End;
      exit;
  end;

  FrameTVCloud.TMSFNCCloudStorageServices.Upload(ciPhotoFolder, FilesToLoad.Strings[i]);

  TThread.ForceQueue(nil, procedure
  begin
    Upload_Files(i);
  end, 200);
end;
1 Like

Hi,

The sample code you provided will try to start all upload requests simultaneously because the request is asynchronous. If you need to upload a large number of files, it is recommended to start the upload requests sequentially. For example, by using the OnUploadFile event to trigger the next upload request after the previous upload is finished.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.