dimanche 21 février 2021

Can't download image/video from URL in JavaScript

I am new at making website and i'm using JavaScript but i'm facing a problem. I get image/video URL from Firebase-Storage but i can't download image/video from their URLs. I have already tried what it says in Firebase Docs,

            var xhr = new XMLHttpRequest();
            xhr.responseType = 'blob';
            xhr.onload = (event) => {
            var blob = xhr.response;
            };
            xhr.open('GET', 'https://www.learningcontainer.com/wp-content/uploads/2020/07/sample-jpg-file-for-testing.jpg');
            xhr.send();

This code above is the code i'have tried but i dont understand why nothing happens when i try this code.




Aucun commentaire:

Enregistrer un commentaire