Skip to content Skip to sidebar Skip to footer

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”.

  1. The “Create a project” window opens.
  2. The start screen of the Firebase console opens.
  3. The “Enter app details” screen opens.
  4. Continue the configuration by following the on-screen instruction.
  5. Check the server key after the project is created.
  6. 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"