Self hosted server - ipfs upload

Hi, ipfs upload not working in self hosted parse server. Same code block is working with moralis own server.

const imageFile = new Moralis.File(nftFile.name, nftFile);
await imageFile.saveIPFS();
const imageURI = imageFile.ipfs();
console.log("imageURI",imageURI)```

Output: imageURI undefined

you can try to use uploadFolder function from web3api on a self hosted sever
you can create a cloud function for that

i was using the above method for a single nft upload. When I try to upload folder instead of this method, I get 413 Payload Too Large error.

How big is the file that you try to upload when you get that error?

File size is 397 KB .

that size should work, it doesnโ€™t seem to be a big size, can you add some logging to check the parameters?

! ()

that content should have only the base64, without that data:image/png:base64, from the beginning

you can also try it directly in docs interface to see if it works with those parameters

I get the same error when I try without base64 at the beginning.

did you try it in docs interface?

yes.

const ipfsPath = await Moralis.Web3API.storage.uploadFolder(ipfsFiles);

It given payload too large error. And this error occur only with self hosted parse server.

did you create a cloud function that receive those parameters and then makes the request to uploadFolder?

What do i need to do in cloud function? Previously, it was enough to run the following code block on the client side.

With the payload too large error, try this change with your self-hosted server.

I changed this line. Error changed as below.

After I moved upload ipfs to cloud, it given an error as below.

For that error with unknown parameter address, try this workaround.

1 Like