Upload an image on IPFS and get its hash

Hi, Iโ€™m trying to upload an image on IPFS.
With v1 I used this code

    let image = canvas.toDataURL("image/png");
	const file = new Moralis.File("image.png", { base64: image });

	await file.saveIPFS();

	console.log(file.hash(), file.ipfs());

How can I get the .hash and .ipfs properties using

await Moralis.EvmApi.ipfs.uploadFolder({
abi
});

Thanks

the result of that function should return the IPFS url that also contains the hash, in this particular case it will upload on a folder, it will also be a path to the file in that IPFS folder

This is the result I got

"path": "https://ipfs.moralis.io:2053/ipfs/QmfL6fMaYJDnizFVj4wxyutDnGMePG2JL95rN2A5mcWyB1/moralis/logo.jpg"

Whatโ€™s the hash and ipfs as in v1??

this is the hash in this case

QmfL6fMaYJDnizFVj4wxyutDnGMePG2JL95rN2A5mcWyB1/moralis/logo.jpg

this is the full IPFS path in a folder

Ah ok, Iโ€™ve to split!!!
Thanks mate

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.