Shto ne probwash towa naprimer :
uses ... ,NMHTTP, ...
function GetFileByUrl ( const RemotePath : String;
const RemoteServerName : String;
const LocalFileName : String
) : Boolean;
var http : TNMHTTP;
begin
Result := true;
http := TNMHTTP.Create ( Self );
with http do
begin
InputFileMode := true;
Body := LocalFileName;
Host := RemoteServerName;
try
Get ( RemotePath );
except
Result := false;
end;
Free;
end;
end;
Primer :
Iskame da downloadnem http://www.server.com/p1/p2/file.ext w
c:\temp\file.txt
if not GetFileByUrl ( '/p1/p2/file.ext','www.server.com','c:\temp\file.txt' ) then
// Error handler