TMSFMXCloudGDrive problems

Hello,


I believe since packet 2.1.1.1 of "TMS Cloud Pack for FireMonkey" (I don't know the version of TMSFMXCloudGDrive) the upload of files to Google Drive produces invalid files. 

I thought it was a problem of mine but today I tested the UCloudStorageDemo to upload a simple text file. The result is that the file inlcudes the header information:

--AaB03x
Content-Disposition: form-data; name="userfile"; filename="test.txt"
Content-Type: application/octet-stream

 here is my text
--AaB03x--



And the seond problem is:
Since the last update of 2.3.1 my app can't find specific folders. Up to version 2.1.1.1 it still works.
The operation should be: find a specific folder and give me the CloudItem. If the folder don't exists than create the folder structure. With the new version the following code don't work anymore.

function Get_GDrive_AppFolder : TTMSFMXCloudItem;

  procedure CheckAndCreateFolders(CIs : TTMSFMXCloudItems; FolderParts : TArray<String>; Level : integer = 0);
  var
    i: Integer;
    CI: TTMSFMXCloudItem;
    fp: Integer;
  begin
    for i := 0 to CIs.Count-1 do
    begin
      CI := CIs.Items;
      if CI.ItemType = ciFolder then
      begin
        if (CI.FileName.ToUpper =  FolderParts[Level].ToUpper) then
        begin
           Inc(Level);
           if CI is TGDriveItem then
           begin
             CI_AppFolderGDrive := CI;
           end;
           if CI.Folder <> NIL then
             CheckAndCreateFolders(CI.Folder, FolderParts, Level)   // recursive
           else
              for fp := Level to Length(FolderParts)-1 do
              begin
                CI := TMSGoogleDrive.CreateFolder(CI, FolderParts[fp]);
                CI_AppFolderGDrive := CI;
              end;
        end;
      end
    end;
  end;

var
  FolderParts : TArray<String>;
const
  cFolderGDrive = 'Apps/Myname/data';
begin
  Result := NIL;

  FolderParts := Helptools.explode('/', cFolderGDrive);  // explode is a funktion like PHP function

  CheckAndCreateFolders(TMSGoogleDrive.Drive, FolderParts);
  Result := CI_AppFolderGDrive;

end;

At the moment I'm not able to use the Google Drive functionality! Do you have a solution?

Best regards

Hi,


1) File upload to Google Drive in android includes header data in files.
We are aware of this issue and are currently investigating how this can be fixed.
If a solution has been found it will be included in the following update of the TMS Cloud Pack for FireMonkey.

2) Can you please explain exactly what is going wrong when you use your code with the new version of the TMS Cloud Pack for FireMonkey?
If possible, please provide a ready to run sample project that demonstrates the issue so I can further investigate this.

Hi,


1) The header data files will not be a problem for me if TMSCloudPack for FM and Windows will clear this header data files after download. At the moment the header information will not be removed.

2) A complete sample project is possible, To which mail address I can send it?

Hi, 


You can send it to support@tmssoftware.com

Kind Regards, 
Pieter

Dear Mr. Schröder, 


We have fixed the issue with upload, the next version will address this issue.
We will investigate the second issue as soon as possible.

Kind Regards, 
Pieter

Hello,


many thanks for fixing the GDrive issue about the header information.

The second issue you can test with your CloudStorageDemo! 
The method GetDriveInfo() produces an access violation in FMX.TMSCloudBase line 4980. That's why I don't get drive information and my app produces the folder structure again and again...

Or use this small sample:

procedure TForm.Button1Click(Sender: TObject);
var
  acc: boolean;
  CI: TTMSFMXCloudItem;
begin

  TMSFMXCloudgdrive1.App.Key := myGoogleAppKey;
  TMSFMXCloudgdrive1.App.Secret := myGoogleAppSecret;

  if TMSFMXCloudgdrive1.App.Key <> '' then
  begin
    TMSFMXCloudgdrive1.LoadTokens;

    acc := TMSFMXCloudgdrive1.TestTokens;

    if not acc then
      acc := TMSFMXCloudgdrive1.RefreshAccess;

    if not acc then
    begin
      TMSFMXCloudgdrive1.DoAuth;
      exit;
    end
    else
    begin
      TMSFMXCloudgdrive1.GetDriveInfo; // it crashes
      TMSFMXCloudgdrive1.FillTreeView(TreeView1);
    end;
  end
  else
    ShowMessage('Please provide a valid application ID for the Storage component');
end;


All the best
Heiko

Hi, 


The second issue will also be fixed in the next release.

Kind Regards, 
Pieter