Android and sftp download storage (SOLVED) lazarus / 43-Android ---------------------------------------------------------------------- xinyiman · 2023-04-11 19:49 Hi, someone explains which code to use to not have problems in downloading an SFTP file in the local one? Let me explain better, I use the following code Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TAndroidModuleSync.AndroidModuleSyncRequestPermissionResult(  Sender: TObject; requestCode: integer; manifestPermission: string;  grantResult: TManifestPermissionResult);begin     case requestCode of     1198:begin            if manifestPermission = 'android.permission.WRITE_EXTERNAL_STORAGE' then            begin              if grantResult = PERMISSION_GRANTED  then                   ShowMessage('Sucess... PERMISSION_GRANTED !!!')                else                 ShowMessage('Error... [PERMISSION_DENIED] download/upload ok....');            end;          end;     end;end; and Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i            if IsRuntimePermissionGranted('android.permission.WRITE_EXTERNAL_STORA GE') then          begin                SFTPClient1.Download('/root/mydir/input.zip', Self.GetEnvironmentDirectoryPath(DirDownloads) + System.DirectorySeparator + 'input.zip')          end          else Log('ERRORE... [PERMISSION_DENIED] il download del file non è consentito ...');    But it never works on the old devices with Android 10. It always tells me that I don't have the permits, even if I have set them. Other ways to download the file? ---------------------------------------------------------------------- jmpessoa · 2023-04-11 21:16 Quote/root/mydir/input.zip What ??? ---------------------------------------------------------------------- xinyiman · 2023-04-12 06:30 It is the path to the file on the sftp server ---------------------------------------------------------------------- MarkMLl · 2023-04-12 08:02 Quote from: xinyiman on April 12, 2023, 08:30:54 amIt is the path to the file on the sftp server What makes you think that the sftp daemon is being run by root on the server? These days that would be most unusual, particularly on a unix server, and most particularly for something with as little security as tftp. MarkMLl ---------------------------------------------------------------------- xinyiman · 2023-04-12 08:16 The path is correct. Don't worry, because I see the file. The problem is related to saving to local storage. It always tells me that I don't have the permissions, even though I have them activated. ---------------------------------------------------------------------- jmpessoa · 2023-04-12 18:47 With each new version android is making it difficult to access directories outside the scope of the application....  for Android >= 10 you can try this demo:   "AppPublicFoldersAccessDemo1" ---------------------------------------------------------------------- xinyiman · 2023-04-16 08:53 But I'm also fine with saving the zip in a directories inside the scope of the application. How can I do? My goal is to download a zip file that has excel files inside to read. Once read I can delete them. ---------------------------------------------------------------------- Mongkey · 2023-04-21 03:44 you need to unzip it, read what contain inside. May be zip GUI sample project your best companion for this. ---------------------------------------------------------------------- xinyiman · 2023-04-22 22:23 Quote from: Mongkey on April 21, 2023, 05:44:24 amyou need to unzip it, read what contain inside. May be zip GUI sample project your best companion for this. Thank you very much. I solved.