comp.lang.ada
 help / color / mirror / Atom feed
From: landgraf <pavel.y.zhukov@gmail.com>
Subject: Downloading of large file with AWS
Date: Wed, 25 Mar 2015 03:18:56 -0700 (PDT)
Date: 2015-03-25T03:18:56-07:00	[thread overview]
Message-ID: <32becb99-faaa-41b8-a0ef-aa76bc3fe716@googlegroups.com> (raw)

I'm looking for a way how to download file using GET request and monitor the progress.
The problem is length of the file can be obtained by separate request only (browser/wget don't know length of the file because of this).
I'm pretty sure I did this last year but lost the code.

The process looked like:

procedure Download (URL : String; Length : Natural, Connection : in out AWS.Client.HTTP_Connection) is
  buffer : Stream_Element_Array (1 .. Size);
  Last : Stream_Element_Offset;
  Left : Natural;
  --  task to monitor the progress omitted
begin

  loop
     -- Procedure to start the process ??
     exit when Left = 0;
      AWS.Client.Forgotten_Procedure_to_Read_Chunk (Connection, Buffer, Last); -- !! I forgot how to do it. Probably it can be done with AWS.Client.Read(_Some) but no success so far
      Left := Left - Natural (Last);
      -- append buffer to file
   end loop;
end Download;

Any AWS experts (Pascal?) here? 


             reply	other threads:[~2015-03-25 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 10:18 landgraf [this message]
2015-03-25 15:09 ` Downloading of large file with AWS landgraf
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox