Restricting FileUpload to Only Use Camera Photos (No Gallery Selection) – Perspective

I'm developing a project in Ignition Perspective that uses the FileUpload component. At certain points in the process, the user is required to capture a real-time photo to verify that specific conditions have been met—such as a clean environment or a properly completed task. These photos serve as visual evidence.

For this reason, I would like to restrict the upload functionality so that only images taken directly with the camera can be submitted, preventing the selection of files from the device’s gallery or file system. The goal is to ensure greater reliability and authenticity in collecting this evidence.

Is there a way to configure the FileUpload component (or use an alternative) to allow only the use of the camera? Any workaround or browser-specific solution would also be appreciated.

This isn't possible in any reliable way.
As a webview, ultimately the best you could do is provide a hint to the mobile OS using the capture attribute. This isn't currently exposed on the file upload component, so to do this in the short term would require a completely custom component or some frontend hacking (talk to @bmusson, maybe). But even if you were able to provide that value, it's still nothing more than a 'hint' to the user agent and not a guarantee that you're getting true live camera input.

I kind of solved this by looking at the file name. iOS seems to always name the new photo to "image.jpg"

Photos also have metadata associated with them. Unless the user is using an app to scrub it you could just check the EXIF for the timestamp and reject it if its not taken within X timeframe.

You can now do this using Embr Periscope's Client Resource feature:

In a Client Resource module, you can write a custom input component that has a capture attribute.

You'll need to manually handle routing the onChange event to the Gateway.
I'd recommend either:

  1. Sending the file to a WebDev endpoint.
  2. Explore using the client-side FileUploadUtility + a custom Page event listener subscribed to FileUploadModelDelegate.FileUploadedToPageEvent's.
  3. Possibly sending the bytes to a message handler if the file size isn't too large.

You can achieve this using WebDev module by writing HTML, CSS, and JavaScript to handle image functionality. The application can allow users to either download the image or store it in a database, depending on the requirement.