I have a requirement to upload documents from camera only and not from phone's gallery/album or something like i can check the created/lastmodified date of the file to check if it is captured at that time or is it old document.

I am using lightning-file-upload in lwc. how can i achieve this.

Below is the piece of code which i am using.

    label="Upload Document"
    accept=".pdf, .png, .jpg"

handleUploadFinished(event) {
// Get the list of uploaded files
    const uploadedFiles = event.detail.files;
    alert("No. of files uploaded : " + uploadedFiles.length);

is there any attribute like onchange or onsubmit where atleast i can verify the lastmodified/created date of the file which is being uploaded. or any other method to open only the camera and not to promt for gallery and album options in mobile.

Any help would be highly appreciated. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.