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

100
Views
in Firebase I am not able to upload image

in firebase if I want to upload a file its not working perfectly, what is the mistake I did ,here I have use all the code in a one js file

import { React, useState } from "react";
import { initializeApp ,storage} from "firebase/app";
import "firebase/storage"
export default function Demo() {
  const [search, setSearch] = useState("");
  const firebaseConfig = {
    apiKey: "VIzaSyDkgE2z3IIXr50AumPXmUfkoimM3f4z9d",
    authDomain: "reactform-95c40.firebaseapp.com",
    databaseURL: "https://reactform-65c50-default-rtd12.firebaseio.com",
    projectId: "reactform-89c93",
    storageBucket: "reactform-67c52.appspot.com",
    messagingSenderId: "793300985055",
    appId: "1:793300985055:web:aa37c4b76870f21f6d9a90"
  };
  initializeApp(firebaseConfig);
  const upload = (e)=>{
    if(search == null)
      return;
    storage.ref(search.name).put(search)
    .on("state_changed" , alert("success"));
  }
  return (
    <>
      <input type="file" onChange={(e)=>{setSearch(e.target.files[0]);console.log('loading...')}}/>
      <button onClick={(e)=>{upload(e)}}>Upload</button>
    </>
  );
}
about 4 years ago · Juan Pablo Isaza
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!