_ws.bufferedAmount > g_step * 10)
                setTimeout(function() { loadSuccess(e.loaded); }, 100);
            else
                loadSuccess(e.loaded);
        }

        readBlob();
    }

    function loadSuccess(loaded) {
        var blob = g_reader.result;
        if (g_loaded == 0) {
            g_ws.send(g_file.name);
            var len = "" + g_file.size;
            g_ws.send(len);
        }

        g_ws.send(blob);
        g_loaded += loaded;

        if (g_loaded < g_total)
           