Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Upload wia IdHTTP - Fortschritt anzeigen??? (https://www.delphipraxis.net/23405-upload-wia-idhttp-fortschritt-anzeigen.html)

romber 2. Jun 2004 17:27


Upload wia IdHTTP - Fortschritt anzeigen???
 
Hallo!

Ich lade auf den Server eine Datei hoch:

Code:
...
var
PicData: TIdMultiPartFormDataStream;

PicData := TIdMultiPartFormDataStream.Create;
PicData.AddFile('file', 'C:\Datei.exe', 'application/zip');
IdHTTP1.Post('http://www.homepage.de/cgi-bin/loadPicture.pl?', PicData);
...
Ich möchte dem User auch zeigen, wie weit der Uploadprocess ist. Beim download ist klar:

Code:
...
procedure TForm1.IdHTTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer);
begin
ProgressBar1.Max := AWorkCountMax;
application.ProcessMessages;
end;
...
Code:
...
procedure TForm1.IdHTTP1Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer);
begin
Label1.Caption := IntToStr(AWorkCount div 1024) + ' Kb von ' + 
IntToStr(http.Response.ContentStream.Size div 1024) + ' Kb';
ProgressBar1.Position := AWorkCount;
application.ProcessMessages;
end;
...
Kann ich diese Code irgendwie modernisieren, sodass der Upload-Fortschritt angezeigt wird?


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:58 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz