Error in storing HTML content with image in a file in spring boot

Viewed 86

Hello I want to store email templates HTML Coded with images in a file and I got an error that entity is too large, However, it works fine with tiny images but whenever I want to store big images it shows me Entity too large error

For storing the image to file I use spring boot APIs where I get HTML coded content in string format to store into a file

here is some sample of HTML content receiving in request parameter

Here is my json Request that works fine

"templateContent": "<h1><span style=\"color: #800080;\">Hello</span></h1>\n<h3>&nbsp;</h3>\n<p>&nbsp;</p>\n<p><span style=\"color: #000080;\">This Is <strong>Kuldeep Vaishnav</strong> working as a Software Engineer<img src=\"https://html-online.com/editor/tinymce4_6_5/plugins/emoticons/img/smiley-cool.gif\" alt=\"cool\" /></span></p>\n<p><span style=\"color: #000080;\">-:Template Properties:-</span></p>\n<table style=\"width: 318.583px;\" border=\"solid\">\n<tbody>\n<tr>\n<td style=\"width: 21px;\">id</td>\n<td style=\"width: 65px;\">Detail</td>\n<td style=\"width: 238.583px;\">Properties</td>\n</tr>\n<tr>\n<td style=\"width: 21px;\">1</td>\n<td style=\"width: 65px;\">Name</td>\n<td style=\"width: 238.583px;\">REG_WELCOME_MESSAGE_English.html</td>\n</tr>\n<tr>\n<td style=\"width: 21px;\">2</td>\n<td style=\"width: 65px;\">Language</td>\n<td style=\"width: 238.583px;\">Engliash</td>\n</tr>\n<tr>\n<td style=\"width: 21px;\">4</td>\n<td style=\"width: 65px;\">Alias</td>\n<td style=\"width: 238.583px;\">Default</td>\n</tr>\n<tr>\n<td style=\"width: 21px;\">3</td>\n<td style=\"width: 65px;\">Domain</td>\n<td style=\"width: 238.583px;\">Default</td>\n</tr>\n</tbody>\n</table>\n<h3><span style=\"color: #ff0000;\">&nbsp;Thanks</span></h3>\n",

here is my another json content that not works fine i can't even paste here so i will upload Image here Json request value of "templateContent"

Please help me out to store HTML content with an image in a file

Note:- I am receiving that templateContent value from frontend team

1 Answers

This is an issue with the frontend team. They fixed it by adding

app.use(bodyParser.json({ limit: '2000mb' }))

on the Node to set the json size to be up to 200mb.

Related