0

I need to send an image base64 encoded to an API. My json out put got only 10000 characters from the base64 code.

    var data = new Object(); 
    data.image= $('#image').val();
    data.date = new Date($.now()); 
    console.log(JSON.stringify(data));
    $.ajax({
        type: "POST",
        url:  app.url
        data: JSON.stringify(data),
        contentType: "application/json",
        crossDomain: true,
        xhrFields: {
            withCredentials: true
        },
        dataType: "json",
        success: function (data, status, jqXHR) {
        },
        error: function (jqXHR, status) { 
        }
    });

In my console.log i've got the full string, but not in the request.

Thanks

t.c
  • 1,255
  • 1
  • 16
  • 36

2 Answers2

0

You would need to increase your server php.ini upload_max_filesize and post_max_size or you can try this solution Upload base64 image with Ajax

tonoslfx
  • 3,422
  • 15
  • 65
  • 107
0

It was just the chrome console/network display that is limited to 10000 char

t.c
  • 1,255
  • 1
  • 16
  • 36