Hello @johnversus
sure, here is the code
const files = new Moralis.File(imagename, data);
await files.saveIPFS();
let imgurl = files.ipfs();
async function uploadImageOnIPFS(input) {
const data = input;
var imagetype = input?.type?.split("/")
let thumbnailImageUrl;
if (imagetype[0] == “video”) {
let props = { file: data, Moralis: Moralis };
thumbnailImageUrl = await GetVideoThumbnails(props);
thumbnailImageUrlRef.current = thumbnailImageUrl;
console.log(“thumbnailImageUrlRef----------->”, thumbnailImageUrlRef);
}
let imagename = Math.floor(Date.now() / 1000) + "." + imagetype[1];
const files = new Moralis.File(imagename, data);
await files.saveIPFS();
let imgurl = files.ipfs();
imagetypeRef.current = imagetype[0]
setMineType(imagetypeRef.current)
setimageFile(imgurl);
SavetoDraft(imgurl, imagetype);
}