[SOLVED] Error when running music.js file: Request body larger than maxBodyLength limit

I ran this code yesterday on the mumbai testnet and worked fine… now it’s giving mke this error after I set up a new server on the mainnet. Am I missing something? Do I need to use a different API key rather than default?


PS C:\Album> node music.js
Error [ERR_FR_MAX_BODY_LENGTH_EXCEEDED]: Request body larger than maxBodyLength limit
at RedirectableRequest.write (C:\Album\node_modules\follow-redirects\index.js:102:24)
at RedirectableRequest.end (C:\Album\node_modules\follow-redirects\index.js:127:10)
at dispatchHttpRequest (C:\Album\node_modules\axios\lib\adapters\http.js:401:11)
at new Promise ()
at httpAdapter (C:\Album\node_modules\axios\lib\adapters\http.js:48:10)
at dispatchRequest (C:\Album\node_modules\axios\lib\core\dispatchRequest.js:58:10)
at Axios.request (C:\Album\node_modules\axios\lib\core\Axios.js:108:15)
at Axios. [as post] (C:\Album\node_modules\axios\lib\core\Axios.js:140:17)
at Function.wrap [as post] (C:\Album\node_modules\axios\lib\helpers\bind.js:9:15)
at C:\Album\music.js:24:6 {


let fs = require(“fs”);

let axios = require(“axios”);

let media = [“albumcover.png”, “FUNGKU.wav”, “Holes.wav”];

let ipfsArray = [];

let promises = [];

for (let i = 0; i < media.length; i++) {


new Promise((res, rej) => {

  fs.readFile(`${__dirname}/export/${media[i]}`, (err, data) => {

    if (err) rej();


      path: `media/${i}`,

      content: data.toString("base64"),







Promise.all(promises).then(() => {


.post("https://deep-index.moralis.io/api/v2/ipfs/uploadFolder", ipfsArray, {

  headers: {


      "I put Default API Key here",

    "Content-Type": "application/json",

    accept: "application/json",



.then((res) => {



.catch((error) => {




I really appreciate if someone could help with this! :slight_smile:

Maybe the file size is somehow bigger now.
What is the size of the file files that you try to upload to IPFS?

That was it! Just needed to convert wav files to mp3 and it worked! :slight_smile:

1 Like

what is the file size limit for images?


A file size of 10-20MB should work fine when uploading it to IPFS with any endpoint.


Crypto Kid | Technical Support