Mint Nft mp3 data

heres my issue: I want this to lazy mint mp3 files


So how do we get mp3 to upload into our dap? this next line is the input form-control in my html I was thinking id just use

accept=“music/mp3”.


<div class="form_element">
                    <input class="form-control" type="file" accept="image/png, image/jpeg" id="input_image" name="image" placeholder="upload a file">
                </div>

but i dont know if i need to have 2 seperat ids for the image and music or combine it into one, from what i can see i think i need 2 ids but idk how to handle that
Also on the backend there is the js:

im assuming these are the lines in the .js file that need to be changed

async function submit(){
  // get image data 
  const input = document.querySelector("#input_image");
  let data = input.files[0]

  // upload image to ipfs
  const imageFile = new Moralis.File(data.name, data)
  await imageFile.saveIPFS();
  let imageHash = imageFile.hash();

Its from filips latest lazy mint tutorial. My repo https://github.com/MontyWilliams/nft_721_mint.git

you could try to upload mp3 data by changing that to accept=".mp3"
but uploading that mp3 to IPFS doesn’t necessarily mean that it will be properly interpreted by open sea or rarible

Exactly. so i guess i need to refer to the open sea docs to see how to handle it myself? i dont mind but im sure someone already has, or have they?

I personally didn’t do that, so, I don’t know if it even works.

Did you find a solution?

Yes, the solution was to just add the file with the .mp3 extension. Ipfs dosnt care

2 Likes