관리 메뉴

이사작전.com IT Blog

How to fix firebase storage is not a function 본문

Framework/Google Firebase

How to fix firebase storage is not a function

말랑고양 플랫폼공작소 2019. 11. 27. 23:49

Hi there!


today, I will let you know Something!


How to fix the problem (firebase.storage is not a function)


check this!


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<script src="/__/firebase/7.4.0/firebase-auth.js"></script>
<script src="/__/firebase/7.4.0/firebase-storage.js"></script>
<script src="/__/firebase/7.4.0/firebase-firestore.js"></script>
<script src="/__/firebase/init.js"></script>
<script>
 
        function fileUpload(file){
            var metadata = {
                'contentType': file.type
            };
 
            var storageRef = firebase.storage().ref();
            var uploadTask = storageRef.child('images/test').put(file, metadata);
            uploadTask.on('state_changed'function(snapshot) {}, function(error) {
                alert("error!");
            }, function() {
                uploadTask.snapshot.ref.getDownloadURL().then(function(downloadURL) {
                    alert('success!');
                });
            });
        }
 
</script>
cs


Good Luck bro!


#firebase #storeage #firebase storage is not a function

0 Comments
댓글쓰기 폼