Download Json File From Firebase Storage
Let me restate my question. I have a vue.js app that uploads a json file to a bucket in my firebase storage. I need to download the file to use in my app but when I try to download
Solution 1:
Steps to start a Firebase project
Open the Firebase console. Click “CREATE NEW PROJECT”.
- The “Create a project” window opens.
- The start screen of the Firebase console opens.
- The “Enter app details” screen opens.
- Continue the configuration by following the on-screen instruction.
- Check the server key after the project is created.
- Down the server key and store it on your local drive for now.
Now that we have installed dependencies and created a Firebase project, just create an index.js file and paste the below code. Don’t worry, we will go over the code in detail, to understand what is happening.
Solution 2:
Here was the solution for anyone else needing help with this type of issue.
const storage = firebase.storage()
const storageRef = storage.ref()
const objectRef = storageRef.child(course.storageRef)
objectRef.getDownloadURL().then((url) => {
axios.get(url).then((response) => {
let activeCourse = response.data
userActiveCourse.push(activeCourse)
})
})
Post a Comment for "Download Json File From Firebase Storage"