4

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] );


    }
}
Hunt
  • 8,215
  • 28
  • 116
  • 256
  • check this question and accepted answer [http://stackoverflow.com/questions/7033639/javascript-split-large-string-in-n-size-chunks](http://stackoverflow.com/questions/7033639/javascript-split-large-string-in-n-size-chunks) – waldek_h Dec 22 '13 at 09:42
  • 1
    so there is no need to separate it by byte i can directly split it into N numbre of string ? – Hunt Dec 22 '13 at 10:46

0 Answers0