If I have a file made available to a browser through my webapp, I normally just set the URL to something like http://website.com/webapp/download/89347/image.jpg
. I then set the HTTP headers Content-Type: application/octet-stream; filename=image.jpg
and Content-Disposition: Attachment
.
However, on the Android. It seems the only way I can get the file to download is to set Content-Type: image/jpg
. Otherwise the file name says <Unknown>
and an error comes
Download unsuccessful
Cannot download. The content is not supported on this phone
Is there any way I can get Android to download and open the file through the browser without keeping a list of mime types?
To make any downloads work on all (and especially older) Android versions as expected, you need to...
Read my blog post for more details:
http://digiblog.de/2011/04/19/android-and-the-download-file-headers/