New Moralis.File

Hey guys, i’m using
new Moralis.File(“nftfile.png”, createItemFile.files[0]);

to upload png files to ipfs.

I want it to be able to accept(png,jpg, and gifs) how do i adjust the above code to do that?

you can upload any kind of binary data with that function, if you want to accept only a specific format, you’ll have to check the contents of the data before uploading it to IPFS. The extension from that filename on its own can be anything that doesn’t represent the contents of the file

Ah i see now. Thanks bud