I have a webview in my app that is working fine, i can navigate and submit normal forms, click on href, etc. I have one issue with forms that go to a php file that i use to download file.
The code of the php is:
$indice=$_POST['indice'];
$sql_file="SELECT * FROM files WHERE indice=".$indice;
$file=$connect->query($sql_file);
$row=$file->fetch_assoc();
header("Content-Type: {$row['type']}\n");
header("Content-Disposition: attachment; filename=\"{$row['name']}\"\n");
header("Content-Length: {$row['size']}\n");
echo base64_decode($row['data']);
I try to manage the download with the function:
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request)
But is not working because is a submit of a form show this function is not executed, it only execute when you click in a href or similar.
With the function "onPageStarted" i can get the url so i know if i submitted the download form but i cant see the post data.
How can i manage the download? In IOS the webclient did automatically and even load the PDF in the webclient.
Best Regards.