;
    var g_total = 0;
    var g_file = null;
    var g_enableRead = true;

    g_fileBox.onchange = function() {
        g_file = this.files[0];
        g_total = g_file.size;
        if (g_ws == null)
            createSocket(function() { bindReader(); });
        else
            bindReader();
    }

    function bindReader() {
        g_loaded = 0;
        g_reader = new FileReader();
        g_reader.onload = function(e) {
            if (g_enableRead == false)
                return;
            if (g