Hello,
I’m trying to mint an NFT using a static file that is imported locally, so first I want to upload the media file to IPFS using Moralis. This is an example of what I’ve attempted:
import exampleImage from "../example/image.png"
const file1 = new Moralis.File(file.name, {base64:{exampleImage}});
await file1.saveIPFS();
const file1url = file1.ipfs();
Then I use the returned url to create a metadata file. Using the metadata file I can successfully create an NFT, but when I check the NFT on opensea the image seems to be null… I’ve waited and refreshed the metadata a few times within OS and that did not seem to help.
When I input the url I get back from storing the image to IPFS into my browser, it automatically downloads a file not containing my image but instead a string of characters
Lastly, when I attempt to omit the base64 parameter:
const file1 = new Moralis.File(file.name, {exampleImage});
await file1.saveIPFS();
const file1url = file1.ipfs();
I get: “TypeError: Cannot create a Parse.File with that data”
Anyone know what I can do to be able to use my static file with IPFS?
Cheers