i am trying to add a file to ipfs and i am using infura
but i am getting this message instead of uploading
“https://ipfs.infura.io:5001/api/v0/add?stream-channels=true&progress=false”.
const ipfsClient = require(‘ipfs-http-client’)
const ipfs = ipfsClient({ host: ‘ipfs.infura.io’, port: 5001, apiPath: ‘/api/v0’,protocol: ‘https’ })
onSubmit = (event) => {
event.preventDefault()
console.log(“Submitting the form”)
console.log(this.state.buffer)
ipfs.add(this.state.buffer,(error,result) =>{
console.log(“ipfs results”,result)
if (error){
console.error(error)
return
}
//do stuff here
})
}
state variable buffer is set properly