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

115
Views
Sending captured image from front-end to flask back-end

I am trying to capture an image from webcam and send it to backend flask server. I captured the image successfully but am having trouble to send it to the backend.

HTML

        <form method="POST" enctype="multipart/form-data" id="myForm" >
            <table>
                <tr>
                    <td><input type="button" value="Upload" onclick="upload()"></td>
                </tr>
            </table>
        </form>
        <div id="my_camera"></div>
        <input type="button" onclick="snap()" value="Snap">
        <div id="results"></div>

JS

function snap() {
    Webcam.snap( function(data_uri) {
        // display results in page
        document.getElementById('results').innerHTML = 
        '<img id="image" src="'+data_uri+'"/>';
      } );      
}

This basically gives me the image in the image field the created div. So how can I send it to the backend. I thought if there was any way to change file in file type input like we can modify contents in other field using document.innerHTML(). But I don't think it doesn't work that way. What logic can I implement in upload(). Is there an alternative? Thanks!

about 4 years ago · Juan Pablo Isaza
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!