Native node, receives the base64 image sent by ajax. It is too large and is truncated.

Native node, receives the base64 image sent by ajax is too large and is truncated

is it true that the size of the native node is limited and where is the size configured?

related codes

    req.on("data",function(data){
        var currentData = ""
        currentData += data;
        postData = qs.parse(currentData);//postData

        saveImage(postData.smallImage,0)
        saveImage(postData.bigImage,1)
        postData.smallImage = smallImageLink
        postData.bigImage = bigImageLink
        postData.character = postData.character.split(",")
        addData(postData)
    });

ask God for help

Aug.18,2021

var currentData = ""
req.on("data",function(data){
    currentData += data;
});
req.on("end",function(data){
   var postData = qs.parse(currentData);
});

if you use the bodyParser plug-in, you need to set the limit parameter.

if you use nginx, you also need to set the body limit

Menu