Hi everyone,
I want to use the /api/v2/ipfs/uploadFolder endpoint multiple times, is it possible to use the same IPFS folder over and over again, because now I get a new IPFS hanh everytime i call it…
So I use the endpoint like this:
axios.post("https://deep-index.moralis.io/api/v2/ipfs/uploadFolder",
ipfsArrayImg,
{
headers: {
"X-API-KEY": 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
"Content-Type": "application/json",
"accept": "application/json"
}
}
).then((res) => {
//....
}).catch((error) => {
console.log(error)
});
I also tried to use the ‘moralis/node’ library from npm.
For that I used this function:
const imgFile = new Moralis.File(paddedHex, { base64: imageData }, 'image/png');
await imgFile.saveIPFS({ useMasterKey: true });
const imgHash = imgFile.hash();
console.log(`ipfs://` + imgFile.hash());
The code works fine, but this functionality provides a unique hash (for every image) everytime and I can’t save my images under a specific folder/hash.
Can someone explain me how I can use a IPFS folder hash multiple times. Thank you.