Hi Guys

Hi Guys,
Someone know a example about use a progressbar while downloading files using AmazonAPI ? I know a way using IDHTTP, but AmazonApi use another class to do it.

Regards,
Cleidson.

Comments

  1. Didn't Marco publish something about Amazon APIs quite some time ago? It was a few years before he got appointed. I remember it clearly but I can't remember the details. Worth checking though.

    ReplyDelete
  2. Hi Andrea. The download and upload arent a mistake. The problem is how to show the download progress. I dont know a way to do it. Its very usefull when downloading big files.

    ReplyDelete
  3. A 2 years ago, this article from Cantu was my first help to work with Amazon S3 Cloud.

    ReplyDelete
  4. As I said, I didn't remember the details :) I have never used it, but I remembered I'd seen something about it.
    If you are actively using it, why not contributing to it by adding this yourself?

    Also, I would check to see whether any updates have been made - probably someone had the same need and proposed a change.

    ReplyDelete
  5. I have had a look at the code for you and the component is using Indy internally. So what I would do is simply surface the progress event of the Indy Component to the outside world.

    I think this should work.

    A

    ReplyDelete
  6. Hi Cleidson,
       is simple, you can use three methods of TidHttp class :  onWorkBegin, onWorkEnd, onWork

    with this methos you can set your progress max value in onWorkBegin:

    procedure TForm4.IdHTTP1WorkBegin(ASender: TObject; AWorkMode: TWorkMode;
      AWorkCountMax: Int64);
    begin
       my_progress.min :=0;
       my_progress.max := AWorkCountMax;
    end;

    with onWork

    procedure TForm4.IdHTTP1Work(ASender: TObject; AWorkMode: TWorkMode;
      AWorkCount: Int64);
    begin
      my_progress.position := AWorkCount;
      my_progress.refresh;

    end;


    procedure TForm4.IdHTTP1WorkEnd(ASender: TObject; AWorkMode: TWorkMode);
    begin
     my_progress.position := my_progress.max;
    end;

    ReplyDelete
  7. Hi Ivan Revelli and Alan Patric . Using idhttp is  simple to show the progress, but I m using the class TAmazonStorageService.GetObject and this class, use an  IIPHTTP.doget method to obtain the stream.

    ReplyDelete
  8. Cleidson Barbosa , você conseguiu resolver o progressbar do Delphi usando TAmazonStorageService.GetObject? Estou com essa mesma dúvida.. consigo fazer o upload e o download dos objetos na Amazon S3 mas gostaria de exibir o percentual do download realizado... valeu!

    ReplyDelete

Post a Comment