Bind file upload file to phone camera

By: mukkarram hatim | Asked: 11/28/2023
ForumsCategory: Code HelpBind file upload file to phone camera
mukkarram hatim asked 8 months ago
Hi Peeps! How are you doing today?

Is there a way to do any coding and bind the file upload field to the phone/laptop camera?
1 Answers
Rob LeVineRob LeVine answered 8 months ago
Yes it is possible. I just did it for a client about a month ago. It's a combination of javascript/jQuery, Ajax, PHP, and a formidable hook. I give it about a 6/10 on the complexity scale.
Sharul Hafiz Razak replied 8 months ago

Possible to share how you do it?

Rob LeVineRob LeVine replied 8 months ago

Since it's non-trivial, I'll be happy to do it as a paid job. In general, here's what I did.
1. Upload the file [Javascript/jQuery]
2. Move the file to a known location on the server [PHP via Ajax]
3. Create an entry in WP_POSTS for that file [PHP via Ajax]
4. Retrieve that ID from the new entry [Ajax return value]
5. Store that ID in a hidden field in the Formidable Form [Javascript/jQuery]
6. When the form is submitted, move the value in the hidden field to the Formidable File Upload object that was previously empty [frm_after_create_entry hook]

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
crossarrow-right