Webcam snapshot?

By: Ferdinand Kreittmayr | Asked: 03/22/2023
ForumsCategory: General questionsWebcam snapshot?
Ferdinand Kreittmayr asked 1 year ago
Hi guys, is it possible to use a webcam to take a picture/snapshot when pressing a button and save it to database? i would like to use a form to make a archive of labels of concrete samples. I will have to take maybe nearly hundred pictures a day. of course i could use another software to take the picture and then select the picture in file explorer and upload it. But I try to eliminate as most clicks as possible… any ideas?
8 Answers
Victor Font answered 1 year ago
It would take a lot of custom code and I have no idea how you would upload it to the media library with the upload field unless is was saved to the drive and selected for upload. See this:
Ferdinand Kreittmayr answered 1 year ago
Thx for your answer! it neednt be saved to media library. i would prefer to save it to a mysql database or in a custom folder.
Victor Font replied 1 year ago

You won't be able to store it in the database using Formidable. Formidable only stored field values as text. To store an actual image in the database, you would have to store it to a blob database field. You can't change the metadata schema both WordPress and Formidable use.

As for uploading it to a custom folder and bypassing the media library, you would have to create you're own code to do this. I don't think you can use Formidable's upload field. Even though you can customize the directory, it still requires an attachment id from the media library. The attachment id links the image to the form entry.

What you want to do is completely custom and not available out of the box.

Bobby Clapp answered 1 year ago
Is this a geotechnical engineering need? I've built some applications that can produce a sample ID and apply that to a QR code. Then you can scan the QR code and go to that sample entry and then from within the entry upload multiple photos that are then tied to that entry. Is that sort of what you are going for?
Brent ShermanBrent Sherman answered 7 months ago
There was a webcam plugin feature that worked with the file upload field in FF, possibly created by Vinay Rai or Ranjeet Singh of MrPhpGuru. I've noticed the specific link to this plugin is no longer available at the MrPhpGuru website. I'm going to try to reach out to him via email, and will post an update if he replies. I brushed out part of the image illustration for privacy.
Brent ShermanBrent Sherman answered 6 months ago
Are we allowed to post Code here?
Rob LeVineRob LeVine replied 6 months ago

Sure, though you should use something like so that you can format the code clearly. The code formatting with his forum leaves a lot to be desired.

Brent ShermanBrent Sherman answered 6 months ago
Webcam javascript as a png for Header Section of the insert Headers and Footers plugin
Brent ShermanBrent Sherman answered 6 months ago
Webcam html as a png for html field level.
Brent ShermanBrent Sherman answered 6 months ago
The file upload field button doesn't redirect, however an html button working with the webcam html seems to redirect as if it were a submit button.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community