So an android browser or a webview works fine with urls like this - abc.com/xyz.txt
However, if your URL looks like this - abc.com/xyz.php and what's sent to the browser in the headers is - Content-Disposition: attachment; filename="xyz.txt", then the Android browsers and web view seems to get terribly confused.
It looks like it saves the correct file name on the phone, but the contents is filled with the webpage that was previously being viewed. This works perfectly well on PC based browsers and on an iPhone and Blackberry, it's only a problem on the Android 2.1 and 2.2 (haven't tested others).
Anyone have a solution? Will be very grateful. I really don't want to start storing static files and want to generate my download content on the fly. The log on the phone has revealed no clues.