Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

80
Vistas
React JS Aws İmage Upload Error (Failed to Fetch)

Same code works fine in "react native".

But it doesn't work on the web;

Code:

const target = event.target as HTMLInputElement;

const file: File = (target.files as FileList)[0];

const response = await fetch(file);

  const body = await response.blob();

  await fetch(signedUrl, { method: 'PUT', body, })
    .then(() => {

      console.log('aws succes');

    })
    .catch((err) => {

      console.log('aws', err);

    });

Console:

 TypeError: Failed to Fetch

Thanks for your answers

7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos