Android WebView选择本地文件上传

来源:互联网 发布:linux系统密码破解 编辑:程序博客网 时间:2024/05/02 04:44

This sample demonstrate android webview choose file to upload.
I just implement the client code ,the server code of receiver the file is not implemented.

First of all, you should build the server code by your eclipse(server code wrote by java).

Then update the ip of url(get ip mac command ifconfig windows command ipconfig).
http://192.168.1.109:8080/AndroidMvvmServer/upload

Eventually, Run the android code on your device or emulator.

Android5.1

1. Function :

android webview choose file to upload

2. Android Version

This sample has test in Android3.0、Android4.0、Android 5.0、Android6.0

3. Bug

In the android4.4 version , the web page canot get the right file name if you choose file from Photo not file manager . However it works in lolipop.

Look below gif(android4.4):
android4.4

Referenced document

  1. chromium-webview-samples
  2. file-upload-in-webview

talk is cheap show you the code

1 0
原创粉丝点击