examples/form/dist/index.js
function blobToBase64(blob) {
        var reader = new FileReader();
        var p = new Promise(function (success, fail) {
            reader.onloadend = function () {
                var base64 = reader.result;
                success(base64);
            };
            reader.onerror = function (e) {
                fail(e);
            };
        });

        reader.readAsDataURL(blob);

        return p;
    }
function blobToBase64(blob) {
        var reader = new FileReader();
        var p = new Promise(function (success, fail) {
            reader.onloadend = function () {
                var base64 = reader.result;
                success(base64);
            };
            reader.onerror = function (e) {
                fail(e);
            };
        });

        reader.readAsDataURL(blob);

        return p;
    }
function blobToBase64 ( blob ) { var reader = new FileReader ( ) ; var p = new Promise ( function ( success , fail ) { reader . onloadend = function ( ) { var base64 = reader . result ; success ( base64 ) ; } ; reader . onerror = function ( e ) { fail ( e ) ; } ; } ) ; reader . readAsDataURL ( blob ) ; return p ; }
Convert Blob object to base64string
@param {Blob} blob
@returns {Promise} success(base64 string), fail(error)
Convert Blob object to base64string