-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDownload.txt
More file actions
25 lines (23 loc) · 833 Bytes
/
Download.txt
File metadata and controls
25 lines (23 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
procedure TF_Principal.DownloadApp;
var
Caminho_D: String;
MyFile : TFileStream;
begin
{$IFDEF ANDROID}
{Verifica se o arquivo já existe na pasta de downloads. Apaga caso exista e cria novamente}
if FileExists(GetSharedDownloadsDir + '/app.apk') then
DeleteFile(GetSharedDownloadsDir+'/app.apk');
{Difinição do link de download}
{Nesse momento, você deverá informar o link completo para o download do arquivo}
Caminho_D:= DM.QRY_ParamENDFTP_APK.AsString;
{Criação a instância do tipo TFileStream}
{Aqui informamos o local (diretório no mobile) onde o aplicativo será baixado}
MyFile := TFileStream.Create(GetSharedDownloadsDir+ '/app.apk', fmCreate);
try
{Download do arquivo}
IdHTTP.Get(Caminho_D, MyFile);
finally
MyFile.Free;
end;
{$ENDIF}
end;