-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

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, 2022 at 20:21

1 Answer 1

0

You can do this

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

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.