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

90
Views
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
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!