简体   繁体   English

Nodejs 负载在 base64string 上太大(Http 413)

[英]Nodejs Payload too large(Http 413) on base64string

I uploaded an Image of size 413kb and whenever I convert to base64string and send it over to nodejs server, I got a payload too large error with 413 error code.我上传了一个大小为 413kb 的图像,每当我转换为 base64string 并将其发送到 nodejs 服务器时,我都会收到一个带有413错误代码的payload too large错误。 Does it mean that the size of base64string is not dependent on the size of image converted.这是否意味着base64string的大小不依赖于转换图像的大小。 Articles found only stated that base64string is 1.3333 time bigger than actual size , but how is 413kb a payload too large .找到的文章只说base64string比实际大小大1.3333倍,但是413kbpayload too large怎么payload too large

Already did this but didn't solve the issue.已经这样做了,但没有解决问题。

app.use(bodyParser.json({limit: "9091990mb"}));
app.use(bodyParser.urlencoded({limit: "9091990mb", extended: true, parameterLimit:90000}));

app.use(fileUpload({
    limits: { fileSize: 50 * 1024 * 1024 },
}));

In my case I noticed I had the following lines of code:就我而言,我注意到我有以下几行代码:

 app.use(express.json()); app.use(express.urlencoded({ extended: false }));

So, what I did was comment the lines (or remove it) and it worked just fine.所以,我所做的是评论这些行(或删除它)并且它工作得很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM