Mobile App: how to upload photo directly from phone camera

Hi, using erpnext mobile app I want user to click a button to open phone camera and upload image taken from phone camera that will be saved in the doc

For example:
Doctype name = Daily Report
Fieldname from camera upload = Photo 1, Photo 2, Photo…n

I saw another post suggesting this custom script but I do not know how to implement it.
Would appreciate your kind guidance
Thank you

const capture = new frappe.ui.Capture()
capture.open()
capture.click((data) => {
// do stuff.
})

1 Like