我想下載URL的值,並將其存儲在數據庫火力,如何獲得火力地堡存儲下載URL的值,並將其存儲在存儲火力...,
var uploadTask = storageRef.child('video/' + file.name).put(file,metadata);
//檢查上載進度
uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'
function(snapshot) {
// Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded
var progress = (snapshot.bytesTransferred/snapshot.totalBytes) * 100;
console.log('Upload is ' + progress + '% done');
switch (snapshot.state) {
case firebase.storage.TaskState.PAUSED: // or 'paused'
console.log('Upload is paused');
break;
case firebase.storage.TaskState.RUNNING: // or 'running'
console.log('Upload is running');
break;
}
}, function(error) {
switch (error.code) {
case 'storage/unauthorized':
// User doesn't have permission to access the object
break;
case 'storage/canceled':
// User canceled the upload
break;
case 'storage/unknown':
// Unknown error occurred, inspect error.serverResponse
break;
}
}, function() {
所以,我要的是得到downloadURL的價值和存儲,但我不是一個JavaScript專家,所以我不知道如何得到它的變量值
// Upload completed successfully, now we can get the download URL
var downloadURL = uploadTask.snapshot.downloadURL;
console.log(downloadURL);
});
所有我想要的是從另一個函數獲取價值得到了信息,以做到這一點,它有很多關於瞭解JavaScript函數和訪問數據中的其他功能.. ...., –
你有沒有試過我的解決方案,看看它是否工作? – Lirianer