Hi ! I'm using the uibuilder node. I made a webpage that has an image file input. The webpage outputs to node-red in a JSON as base64 string using the uibuilder.send function. It works well with small images (ex: 116Kb), but the problem seems to arise when I try bigger images (ex: 1.2Mb ), the JSON will still be sent and every other JSON key will be there, but the one key that is supposed to have the base64 string will become null. When I monitor the 2nd outlet of the uibuilder node, I see that the client disconnects and reconnects whenever I try to upload bigger images.
Thanks for any help you can provide!
Hi, thanks for using UIBUILDER. The answer to your question is in the docs but probably not all that clear.
The issue is related to the use of Socket.IO which a few versions ago decided to further restrict the maximum message size due to a few people having had some issues.
But UIBUILDER has you covered as always.
The client connect message from the server tells the client about the max size. It defaults to 1MB total message size.
You can, however, set this in Node-RED's settings.js
file. Details here:
There is an optional uibuilder
property in settings. That is an object with various uibuilder-related global settings including:
/** Custom settings for all uibuilder node instances */
uibuilder: {
/** Optional: Socket.IO Server Options.
* See https://socket.io/docs/v4/server-options/
* Note that the `path` property will be ignored, it is set by
* uibuilder itself. You can set any other setting, though you
* might break uibuilder unless you know what you are doing.
* @type {Object}
*/
socketOptions: {
// Make the default buffer larger (default=1MB)
maxHttpBufferSize: 1e8 // 100 MB
},
},
Thanks a lot! I was just about to reply that I had found in the disconnect message: Max payload size Exceeded! But you were faster and provided the solution! Amazing! Thanks for your time and great nodes!