Unfortunately, I really have to write this in Javascript - the Elixir program just receives the chunks, sent by Ajax from Javascript