5

I am trying to use Spray to download a medium-sized file, say a video, from my Scala app.
What I need is to download the file and, for every chuck that I receive (possibly the chuck dimension is something I would set via config), to track the progress of the whole process (a.k.a. progress-bar like).
Additional, I would like to avoid to have the whole file in memory before saving it, instead saving each chuck as I receive it (and log it).

I looked at the documentation, and a bit online.
However, I can't seem to find a clear way of doing this.
The only thing I found was this link which says that this use-case was not supported by spray-client at the time and I should use spray-can directly...no example though, so I am still a bit confused.

Can anybody suggest an approach? Point me in the right direction? How would you download a file of, say, 30MB?

Thanks

mdm
  • 3,928
  • 3
  • 27
  • 43
  • I have not tried it, but http://spray.io/documentation/1.2.1/spray-can/http-client/#chunked-requests describes a similar option for Connection-level API. – Gábor Bakos Mar 26 '14 at 19:58
  • Thanks Gabor, I have seen that, but without even a trivial example I can't seem to see how to use it... – mdm Mar 26 '14 at 20:03

0 Answers0