divide base64 encoded string into small chunks

Viewed 3703

i am trying to send a base64 encoded data to server but at a time i can send 65535 bytes of data to server and my string size of base64 encoded image is 111751 bytes.

so how can i divide the content of base64 encoded string into small piece of 65535 bytes of block in javascript or jquery.

i am using jquery.base64.js

function readImage(input) {
    if ( input.files && input.files[0] ) {
        var FR= new FileReader();
        FR.onload = function(e) {

        var blockString = e.target.result;
            // here its showing 111751 bytes
        console.log(blockString.length); 




        };       

        FR.readAsDataURL( input.files[0] );


    }
}
0 Answers
Related