🏪Web3API.storage (IPFS)

Upload multiple files and place them in a folder directory (ERC1155 Compliant)

🔥 uploadFolder (new)

Uploads multiple files and place them in a folder directory. Returns path (asynchronous).

The size limit is 50 MB

Options:

  • abi(required): Array of JSON and Base64 Supported

const options = {
  abi: [
    {
      path: "moralis/logo.jpg",
      content:
        "iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAApgAAAKYB3X3",
    },
  ],
};
const path = await Moralis.Web3API.storage.uploadFolder(options);

Example result:

[
  {
    path: "https://ipfs.moralis.io/QmPQ3YJ3hgfsBzJ1U4MGyV2C1GhDy6MWCENr1qMdMpKVnY/moralis/logo.jpg",
  },
];

Tutorial

Legacy UI is present in this video, some things might be slightly different

If using axios like in the video you need to specify some "maxBodyLength" in the request object, see below for example

axios.post('https://deep-index.moralis.io/api/v2/ipfs/uploadFolder',
            arrayToUpload,
            {
                headers: {
                    'X-API-KEY': '',
                    'Content-Type': 'application/json',
                    accept: 'application/json'
                },
                maxBodyLength: Infinity
            }
)

Last updated