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

111
Views
react firebase image post 400 error on uploading

I am trying to upload an image to a cloud storage and received an post 400 error

The file is in initialize in another component.

Thanks for help

const projectStorage = getStorage();

useEffect(() => {

    const storageRef = ref(projectStorage, file.name);

    uploadBytes(storageRef, file).then((snap) => {
        let percentage = (snap.bytesTransferred / snap.totalBytes) * 100;
        setProgress(percentage);
        console.log('File Uploaded');
    }, (err) => {
        setError(err);
    }, async () => {
        //this url doesnt change the setstate url becuase it is in seperate score
        const url = await storageRef.getDownloadURL();
        setUrl(url);
    })

}, [file]);

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

0

I created a new project on firebase and then change the permissions on the storage rules and its works.

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!