Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
extra info being added to image from input file in formData fetch request

Uploading image to S3 from typescript react client side but for some reason appending that file to formData adds extra info to the file (which corrupts it and can't be opened after downloading from S3). After removing that extra info from a text editor, the image opens fine. Anyone know why this is happening? I'm using fetch API with FormData

const onFileChange = (e: ChangeEvent<HTMLInputElement>) => {

    const formData = new FormData();
    if (e.target.files) {
      formData.append("file", e.target.files[0]);

      fetch(url, {
        method: "PUT",
        body: formData,
        headers: {
          "Content-Type": e.target.files[0].type,
        },
      })
        .then((response) => {
          console.log(response);
        })
        .catch((err) => {
          console.log(err);
        });
    }
  };

<input
    type="file"
    accept="image/*"
    name="photo"
     onChange={(e) => onFileChange(e)}
  />

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda