How do i launch camera after clicking input file in my webviewer?

I have created a webview which allow user to take a picture with the camera app and upload their file into the database. The application is able to get the image. However after submitting, i got a "net:ERR_FILE_NOT_FOUND" . Here's a screenshot of my blocks and output.


What is the value of the content uri you are trying to upload?
I'm not sure, if setting the FileAccess property like this is correct... @vknow360 ?
Taifun

You are right, it is incorrect.
If FileAccess property is enabled only then that event is invoked.

So it must be set just next to SetWebView method.

Hey @vknow360, I am sorry I don't understand on implementing this. Could you maybe screenshot a sample for demonstration? Also, I wish to upload a content of image @Taifun

Before or after?


@Alex123 just try it

Taifun

@Kevinkun tested it but the application has lead me into this error
image

Here's a screenshot of my updated block.
image

The MakeFullPath block does not make sense in your case.. you are working with a remote url, don't you?

Taifun

yes

this works:

@Taifun since this file:// is not needed, please remove it from source code, so it can accept full path and absulute path.

EDIT:
In fact, this TaifunFile.GetUri is not necessary.

this also works (if the image path starts with "file:///"):
image

1 Like

Still having this error :sob:
image

Here's the block

read my last post again.

OMG this solution finally works! Thanks @Kevinkun appreciate it
image

this is my fault to direct you to use another extension to change path to Uri.
in fact this contentUri accept full path.

1 Like

@Kevinkun FYI, this works on AI Companion Emulator. However, it doesn't work after being exported into .APK file. Any suggestions on this? :sweat_smile:

image

What is the path to the taken image?
Use additionally a label in the After Picture event to display it...

Taifun

It's working on my phone after install the apk.
My phone is Android 11. What's yours? Maybe you need to manually ask reading permission.

file:///storage/emulated/0/AppInventor/data/Pictures/app_inventor_xxxxxx.jpg

I am using bluestacks v5.10.210.1003 N32. Tried using an android device which also has the same issue too

andriod version? and have you asked reading permission?