Bug fix (thanks to Damyan Petkov): upon disconnection and page reload, sometimes the uploaded file ends up broken because the first chunk was uploaded again