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

91
Vistas
cannot view post request image in console

i have a canvas where is stream video, i'm taking a snapshot of that and sending it to a server how do i know that i have sent the snapshot successfully to server ? i cant see anything in 'Preview' section and should my payload look like that ?. I can see the snapshot in front end using that img tag. status is :

enter image description here

and in payload getting:

enter image description here

and there is nothing in 'Preview'

enter image description here

const canvasRef = useRef(null);
  const [preview, setPreview] = useState('');

  const getImage = () => {
    return new Promise((resolve) =>
      canvasRef?.current.toBlob((blob) => {
        const src = URL.createObjectURL(blob);
        setPreview(src);
        resolve(blob);
      }),
    );
  };
 
 
 const takeSnapshott = async () => {
    let pollUrl = `api/cam/${first}/${second}/snap`;
   
    const blob = await getImage();
    // SEND THE BLOB TO YOUR SERVER
    const formData = new FormData();
    formData.append('file', blob, 'picture');
    try {
      const res = await fetch(pollUrl, {
        method: 'POST',
        headers: {
          'Content-Type': 'multipart/form-data',
        },
        body: formData,
      });
      const data = await res.text();
      console.log('resso', data);

      if (res.ok) console.log('SUCCESS', data);
      else throw new Error(data);
    } catch (e) {
      console.error(e);
    }

          <img src={preview} style={{ width: '100%', height: 'auto' }} />

about 4 years ago · Santiago Gelvez
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