title: android - Cannot upload fil in my webview app
body: <p>i've been creating an webview app for my website, but i can't upload any file to my website since my webview app. I mean, when i try to upload files to my website since Chrome or any other internet browser there's no problem, but when i try to do the same since my webview app, it doesn't happen anything. Here's the code, any help is good recived.</p>
  <pre><code>import android.content.Context;
  import android.content.Intent;
  import android.graphics.Bitmap;
  import android.net.Uri;
  import android.os.Build;
  import android.os.Bundle;
  import android.os.Environment;
  import android.provider.MediaStore;
  import android.util.Log;
  import android.view.View;
  import android.webkit.ValueCallback;
  import android.webkit.WebChromeClient;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  
  import androidx.activity.result.contract.ActivityResultContracts;
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
  
  import java.io.File;
  import java.io.IOException;
  import java.text.SimpleDateFormat;
  import java.util.Date;
  
  public class MainActivity extends AppCompatActivity {
  
      String url = &quot;https://nitrotec.store/&quot;;
      SwipeRefreshLayout myswiperefreshlayout;
      WebView mywebview;
      final Context context = this;
  
      private final int MY_PERMISSIONS_REQUEST_READ_PHONE_STATE = 0;
      private final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 0;
      private final int MY_PERMISSIONS_REQUEST_READ_CAMERA = 0;
      private static final String TAG = MainActivity.class.getSimpleName();
      public static final int INPUT_FILE_REQUEST_CODE = 1;
  
      private ValueCallback&lt;Uri[]&gt; mFilePathCallback;
      private String mCameraPhotoPath;
  
      @Override
      protected void onCreate(Bundle savedInstanceState){
          //RequestPermissions();
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          mywebview = (WebView) findViewById(R.id.webview);
          assert mywebview != null;
  
          WebSettings webSettings = mywebview.getSettings();
          webSettings.setJavaScriptEnabled(true);
          webSettings.setSupportZoom(true);
          webSettings.setAllowFileAccess(true);
          mywebview.getSettings().setAppCacheEnabled(true);
          mywebview.getSettings().setDatabaseEnabled(true);
          mywebview.getSettings().setDomStorageEnabled(true);
  
  
          if (Build.VERSION.SDK_INT &gt;= 22){
              webSettings.setMixedContentMode(0);
              mywebview.setLayerType(View.LAYER_TYPE_HARDWARE, null);
          }else if (Build.VERSION.SDK_INT &gt;= 19){
              mywebview.setLayerType(View.LAYER_TYPE_HARDWARE, null);
          }else if (Build.VERSION.SDK_INT &lt; 19){
              mywebview.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
          }
  
          mywebview.setWebViewClient(new WebViewClient());
          mywebview.setWebChromeClient(new WebChromeClient());
          //mywebview.setWebChromeClient(new mywebchromeclient());
          mywebview.setWebViewClient(new MyWebViewClient());
          mywebview.setVerticalScrollBarEnabled(false);
  
          mywebview.loadUrl(url);
  
          myswiperefreshlayout = this.findViewById(R.id.swipecontainer);
          myswiperefreshlayout.setOnRefreshListener(
                  new SwipeRefreshLayout.OnRefreshListener() {
                      @Override
                      public void onRefresh() {
                          findViewById(R.id.loaderwebview).setVisibility(View.VISIBLE);
                          mywebview.reload();
                          myswiperefreshlayout.setRefreshing(false);
                      }
                  }
          );
  
      }
  
      private class MyWebViewClient extends WebViewClient{
  
          @Override
          public void onPageStarted(WebView view, String url, Bitmap favicon){
              super.onPageStarted(view, url, favicon);
          }
  
          @Override
          public void onPageFinished(WebView view, String url){
  
              findViewById(R.id.loaderwebview).setVisibility(View.GONE);
              findViewById(R.id.webview).setVisibility(View.VISIBLE);
          }
      }
  }
  </code></pre>