I am trying to make a webpage where you can upload a picture and it is uploaded via backend server(node.js) on IPFS.
And I used multer memoryStorage so the backend server does not need to store any data(
checked with diskStorage option and it was storing files correctly, so I do not think the process until this part is wrong).
the backend router code for uploading is like this:
const ipfs = ipfsAPI('ipfs.infura.io', '5001', {protocol: 'https'})
const fileTransfer = async (req, res) => {
const file = req.file
ipfs.files.add(file,(e,r)=>{
if(e){console.log(e)
return}
console.log(r)
console.log(`https://ipfs.io/ipfs/${r[0].hash}`)
})
}
and I got the result like this:
[
{
path: 'QmeVYx .... TufJrB',
hash: 'QmeVYx .... TufJrB',
size: 14214
}
]
but when I try to paste the link on web browser or paste the hash on the app
it shows nothing.
does anyone know why and how to fix this?