Home >Backend Development >PHP Tutorial >javascript - Form input file does not take effect in hybrid development (on Android)

javascript - Form input file does not take effect in hybrid development (on Android)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-08-04 09:21:121407browse

Hybrid development uses PHP as the backend, and adds to the front page. It can be displayed, but the file cannot be selected. This function is to upload pictures and return data.

Reply content:

Hybrid development uses PHP as the backend, and adds to the front page. It can be displayed, but the file cannot be selected. This function is to upload pictures and return data.

What browser are you using? This should be fine

Rewrite WebChromeClient and add a method to it:
public void openFileChooser(ValueCallback uploadMsg, String acceptType, String capture)

<code>    {
        mUploadMessage = uploadMsg;
        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
        intent.addCategory(Intent.CATEGORY_OPENABLE);
        intent.setType("image/*");
        startActivityForResult(Intent.createChooser(intent, "选择图片"), FILECHOOSER_RESULTCODE);
    }</code>



Call the camera directly
Call camera pictures or albums

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn