Notification texts go here Contact Us Buy Now!

File Upload does not work inside Webview, Flutter

Unfortunately, the webview_flutter plugin does not currently support file uploads. You can track the progress of the feature request here.

In the meantime, you can use either the flutter_inappwebview or flutter_webview_plugin plugins as a workaround.


Using flutter_inappwebview

To use the flutter_inappwebview plugin, add the following to your pubspec.yaml file:

``` dependencies: flutter_inappwebview: ^5.0.0 ```

Then, import the plugin into your Dart code:

``` import 'package:flutter_inappwebview/flutter_inappwebview.dart'; ```

Finally, create an InAppWebView widget and set the onFileUpload property:

``` InAppWebView( onFileUpload: (InAppWebViewController controller, FileUploadRequest fileUploadRequest) async { // Handle file upload request here }, ); ```

Using flutter_webview_plugin

To use the flutter_webview_plugin plugin, add the following to your pubspec.yaml file:

``` dependencies: flutter_webview_plugin: ^0.5.0 ```

Then, import the plugin into your Dart code:

``` import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; ```

Finally, create a WebView widget and set the onFileUpload property:

``` WebView( onFileUpload: (FileUploadRequest fileUploadRequest) async { // Handle file upload request here }, ); ```

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.