Hi all,
I am trying to access the HTML input that is under the FileLoader Anvil’s component.
I found a way, but it’s horrible.
I did my homework, or at least I tried for a reasonable amount of time.
According to this doc page I can find the FileLoader’s HTML DIV Element with the code:
Matching Anvil’s page structure and the jso_foto content, points me to the file-loader class, while I need the file-input in order to modify its attributes.
Is there a more elegant, robust way to get that specific input element child of jso_foto?
I need it to be its child because on the page I could have more FileUploaders so I cannot simply rely on searching the class file-input in the whole page.
Thanks for your help!
PS - if you’re asking what I’m trying to accomplish, I am trying to access directly photo camera, video camera and sound recorder in mobile devices. I have found that simply setting file_type to video/*;capture=camera is not enough, attributes video and capture must be set separately.
I can’t find the reference at the moment, but I hit this a little while back and found that the spec for that has changed. On modern browsers, you can just use image/* for the file_type and a mobile device will fire up its camera.
Thanks Owen
I tried this but this opens the Photo Gallery on my phone, not the Camera.
You can try it out cloning the app (just updated) or using it here:
Thanks @daviesian
this was exactly what I was looking for!
I tried to import jQuery and messed around a little trying to figure out the sequence of statements you outlined.
I think a little more in the Docs about how to use jQuery from Anvil could be helpful.