Einzelnen Beitrag anzeigen

sdean

Registriert seit: 5. Dez 2009
64 Beiträge
 
#7

AW: indy idHttp + file download

  Alt 28. Nov 2010, 22:42
thank you Luckie
Here is my Thread Code :
Could you Fix it for me please . many thanks
Delphi-Quellcode:
procedure TFileDownThread.Execute;
var
  FStream: TFileStream;
  i:Integer;

begin

For i:=0 to FUrl.Count-1 do
  begin

  IdHTTP := TIdHTTP.Create(nil);
  try
    IdHTTP.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
    IdHTTP.OnWorkBegin := FWorkBeginEvent;
    IdHTTP.OnWork := FWorkEvent;
    IdHTTP.OnWorkEnd := FWorkEndevent;
    IdHTTP.HandleRedirects:=False;
   // IdHTTP.RedirectMaximum := 15;
   // Idhttp.OnRedirect:=OnRedirect;
    IdHTTP.Head(URL[i]);
    BytesInsgesamt := IdHTTP.Response.ContentLength;

    FStream:= TFileStream.Create(ExtractUrlFileName(URL[i]), fmCreate);
    IdHTTP.Get(URL[i], FStream);

  finally
    IdHTTP.Free;
    FStream.Free;
  
  end;
// Synchronize(ShowCode);
  end;
end;

Geändert von sdean (28. Nov 2010 um 22:44 Uhr)
  Mit Zitat antworten Zitat