title: Upload file in Android 2.2.1 webview using html form
body: <p>I'm developing an Android 2.2.1 app using webview. I can not seem to find a working solution for a file upload. It's a standard file upload form. Webview never pops up the browser box. Under the web browser itself, everything works. In webview, no browsing popup. If you know of a solution, please tell me exactly where to place the added code in the android code section. </p>
  
  <p>File upload form below:</p>
  
  <pre><code>&lt;form name="form" id="fileupload" enctype="multipart/form-data" action="upload.asp" method="post"&gt;
  &lt;input id="blob" name="blob" class="simpleinput" type="file" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Android code below:</p>
  
  <pre><code>package com.pic21.app;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.KeyEvent;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  
  public class pic21 extends Activity {
      /** Called when the activity is first created. */
  
      WebView mWebView;
  
      private class HelloWebViewClient extends WebViewClient {
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              view.loadUrl(url);
              return true;
          }
      }
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          mWebView = (WebView) findViewById(R.id.webview);
          mWebView.getSettings().setJavaScriptEnabled(true);
          mWebView.loadUrl("http://www.m.blah.com");
          mWebView.setWebViewClient(new HelloWebViewClient());
      }
  
      @Override
      public boolean onKeyDown(int keyCode, KeyEvent event) {
          if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; mWebView.canGoBack()) {
              mWebView.goBack();
              return true;
          }
          return super.onKeyDown(keyCode, event);
      }
  }
  </code></pre>