-1

I have Uploaded a fully string data in IPFS:- the URL is:- https://bafybeih3u62l664yz4ffpgrjci6ytl64rbivsgpovv6csty3j6kbx6natm.ipfs.infura-ipfs.io/ I put this URL in browser and it perfectly showing it, is there any way, I can fetch this URL using JavaScript and show it to frontend like a image source attribute

Suvi Negi
  • 31
  • 1
  • Please put your code snippet *in the question* not linked to some external site. Also, this question is too broad, try to focus it on some particular line or lines in your code – JGurtz Mar 19 '22 at 20:21

1 Answers1

0

You can do this

 fetch('https://bafybeih3u62l664yz4ffpgrjci6ytl64rbivsgpovv6csty3j6kbx6natm.ipfs.infura-ipfs.io/')
 .then(response => response.text())
 .then(data =>{
     document.getElementById('yourimg').src = data;
 });
   
    
Sheikh Haziq
  • 229
  • 1
  • 10