Hi my Name is Nicola i have problems create the URL IPS weth moralis

Hi my Name is Nicola i have problems create the URL IPS with Moralis\

<!-- Moralis SDK code -->

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/web3.min.js"></script>

<script src="https://unpkg.com/moralis/dist/moralis.js"></script>
<h1>IPFS Demo</h1>

<button id="btn-login">Login</button><br><br>

<input type="text" name="metadataName" id="metadataName" placeholder="name"><br>

<textarea name="metadataDescription" id="metadataDescription" cols="30" rows="10"></textarea><br>

<input type="file" name="fileInput" id="fileInput"><br><br>

<button onclick=go()>GO</button>

<script>

  // connect to Moralis server

  const serverUrl = "https://3x39a289mxzd.usemoralis.com:2053/server";

  const appId = "XEK6EPv5H5ztG8yAgNJTCwI3tIhwxaE1TPWUuJxg";

  Moralis.start({ serverUrl, appId });

 

  //Loghin function

  login = async () => {

  Moralis.Web3.authenticate().then(function (user) {

  console.log('logged in');

  })

  }

 

  //Uplode ad image

 

  uploadImage = async () => {

  const data = fileInput.files[0]

  const file = new Moralis.File(data.name, data)

  await file.saveIPFS();

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

  return file.ipfs();

  }

 

  //Uplode metadata object

uploadMetadata = async (imageURL) => {

const name = document.getElementById('metadataName').value;

const description = document.getElementById('metadataDesription').value;



const metadata = {

 "name": name,

 "description":description,

 "image": imageURL

}



const file = new Moralis.File("file.json", {base64 : btoa(JSON.stringify(metadata))});

await file.saveIPFS();



console.log(file.ipfs());

}

//function to GO biotton

go = async () => {

 const image = await uploadImage();

 await uploadMetadata(image)

}

what is the exact problem that you have?

Sorry for my spelling i`m Italian.
Iwonth public my Mp4 video colection in Opensee and i need meike my video mp4 in HTLM code i use the codind bat hi ghimy error ā€¦
Live reload enabled.
favicon.ico:1

   Failed to load resource: the server responded with a status of 404 (Not Found)

ipfs.html:51

   Uncaught ReferenceError: gogogo is not defined
at HTMLButtonElement.onclick (ipfs.html:51:30)

Live reload enabled.
2ipfs.html:51

   Uncaught ReferenceError: gogogo is not defined
at HTMLButtonElement.onclick (ipfs.html:51:30)

dis is the contract i use

<!-- Moralis SDK code -->

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/web3.min.js"></script>

<script src="https://unpkg.com/moralis/dist/moralis.js"></script>
<h1>IPFS Demo</h1>

<button id="btn-login">Login</button><br><br>

<input type="text" name="metadataName" id="metadataName" placeholder="name"><br>

<textarea name="metadataDescription" id="metadataDescription" cols="30" rows="10"></textarea><br>

<input type="file" name="fileInput" id="fileInput"><br><br>

<button onclick=gogogo()>GOGOGO</button>

<script>

  // connect to Moralis server

  const serverUrl = "https://3x39a289mxzd.usemoralis.com:2053/server";

  const appId = "XEK6EPv5H5ztG8yAgNJTCwI3tIhwxaE1TPWUuJxg";

  Moralis.start({ serverUrl, appId });

 

  //Loghin function

  login = async () => {

  Moralis.Web3.authenticate().then(function (user) {

  console.log('logged in');

  })

  }

 

  //Uplode ad image

 

  uploadImage = async () => {

  const data = fileInput.files[0]

  const file = new Moralis.File(data.name, data)

  await file.saveIPFS();

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

  return file.ipfs();

  }

 

  //Uplode metadata object

uploadMetadata = async (imageURL) => {

const name = document.getElementById('metadataName').value;

const description = document.getElementById('metadataDesription').value;



const metadata = {

 "name": name,

 "description":description,

 "image": imageURL

}



const file = new Moralis.File("file.json", {base64 : btoa(JSON.stringify(metadata))});

await file.saveIPFS();



console.log(file.ipfs());

}

//function to GO biotton

go = async () => {

 const image = await uploadImage();

 await uploadMetadata(image)

}

Maybe this is the function that is undefined. That syntax with () will call the function directly and not when the button is clicked.

The other error seems to be related to an url that is not found

Hallo Thanks for the replying. I am new in coding Iā€™m a begginer, How do I resolve the problem? Do you have a code that I can use? Some different code? I sent you the link of the video I watched so you can see the purpose of the my code.

you may need to learn a bit more javascript, here are some demo applications using moralis: https://github.com/MoralisWeb3/demo-apps