comp.lang.ada
 help / color / mirror / Atom feed
* Downloading of large file with AWS
@ 2015-03-25 10:18 landgraf
  2015-03-25 15:09 ` landgraf
  0 siblings, 1 reply; 2+ messages in thread
From: landgraf @ 2015-03-25 10:18 UTC (permalink / 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? 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Downloading of large file with AWS
  2015-03-25 10:18 Downloading of large file with AWS landgraf
@ 2015-03-25 15:09 ` landgraf
  0 siblings, 0 replies; 2+ messages in thread
From: landgraf @ 2015-03-25 15:09 UTC (permalink / raw)


nvm
Fixed with 
 AWS.Client.Set_Streaming_Output (Connection.Connection, True);
and using Read


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-25 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25 10:18 Downloading of large file with AWS landgraf
2015-03-25 15:09 ` landgraf

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