Why downloads don’t work in Android stock browser

Why downloads don’t work in Android stock browser

Android stock browser can’t download files received in a POST response.

Yes, this is a bug in Android stock browser and 3 and a half years after the bug has been reported it is still not fixed.

The problem

In your IntraWeb application you have something like that:

procedure TIWForm2.IWButton1Click(Sender: TObject);
begin
  WebApplication.SendFile(‘c:IntrawebMyFile.pdf’, True, ‘pdf’, ‘MyFile.pdf’);
end;

This code works in every single browser, but fails in Android stock browser. This is NOT an IntraWeb bug, but an Android browser bug. Android stock browser (working with Android Download Manager) just can’t handle downloads initiated through POST requests.

Read more about this bug here:

“Support download of POST responses” in http://code.google.com/p/android/issues/detail?id=1780

The funny thing about it is that it was classified as an “enhancement” (not a bug fix) and given medium priority.

More info about download problems in Android can be found here. Quoting an excerpt from that page:

there is a problem with POST requests on many Android devices. It looks like POST does work as expected when the result of the POST request is again a web page, but the POST data gets completely lost when the request initiates a file download.

The IntraWeb application correctly sets all “unusual” required header fields for the Android stock browser, but the browser is buggy and won’t download the file, despite of that.

Solution?

This “issue” is easily recognizable as an Android bug, not an enhancement request. The best solution, so far, is to get your users to use a REAL web browser in their Android devices. There are many free alternatives: Firefox, Opera and Chrome (beta).