2
Hi, I created an application on Delphi
, but she needs to download some files I have on a website, but I have no idea how to do this, please help me. Thank you for reading my question!
2
Hi, I created an application on Delphi
, but she needs to download some files I have on a website, but I have no idea how to do this, please help me. Thank you for reading my question!
2
You can use the function URLDownloadToFile
:
// Inclua em "Uses" a unit "Urlmon"
function BaixarArquivo(const URL, SalvarComo: string): Boolean;
var
H: HRESULT;
begin
H := URLDownloadToFile(nil, pchar(URL),
pchar(SalvarComo),
0,
nil);
Result := H = S_OK;
end;
Example of use:
if BaixarArquivo('http://www.fooBAR.com/baz.poo', 'C:\baz.poo') then
ShowMessage('Arquivo baixado com sucesso!')
else
ShowMessage('Falha ao baixar arquivo.');
There is also how to do this with the component TIdHTTP
with the method Get
.
Browser other questions tagged delphi delphi-xe4 object-pascal
You are not signed in. Login or sign up in order to post.
Thanks friend! This way it worked!
– Nustler Nustler