您的位置:首页 > 移动开发

Android WebView选择本地文件上传

2016-03-25 16:11 489 查看
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.



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):



Referenced document

chromium-webview-samples

file-upload-in-webview

talk is cheap show you the code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: