Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
No puedo agregar ningún archivo a Firebase Storage con Vue.js
<template> <div> <input type="file" id="dosya" @change="putDesign()" /> </div> </template> <script> import { initializeApp } from "firebase/app"; import { getStorage, ref } from "firebase/storage"; const firebaseConfig = { apiKey: , authDomain: , databaseURL: , projectId: , storageBucket: , messagingSenderId: , appId: , }; const app = initializeApp(firebaseConfig); const storage = getStorage(app); export default { data() { return { fileName: "", }; }, methods: { putDesign() { this.fileName = document.getElementById("dosya").files[0].name; const designRef = ref(storage, "design/" + this.fileName); designRef.put(this.fileName); }, }, }; </script>

Hola amigos, estoy tratando de agregar archivos a Firebase Storage, pero me da este error: designRef no es una función. También probé otras formas que encontré en Internet, pero no pude hacerlo. ¿Cómo puedo agregar archivos a Firestore Storage?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Modular SDK no tiene un método put() . Necesitas usar uploadBytes . Además, se debe pasar el archivo en sí mismo en lugar de solo el nombre del archivo:

 const file = document.getElementById("dosya").files[0] this.fileName = file.name; const designRef = ref(storage, "design/" + this.fileName); uploadBytes(designRef, file).then((snapshot) => { console.log('Uploaded:', file.name); });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!