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?
Go to Settings > Storage and check the Android's total and available storage space. If you are running low, try uninstalling any apps, videos, pictures, or other media. This is definitely a possibility you are unable to download any attachments, apps, and picks, and why the usual tricks aren't working.
Click on "Settings" and you'll see a new page pop up in your Chrome browser window. Scroll down to Advanced Settings, click Downloads, and clear your Auto Open options. Next time you download an item, it will be saved instead of opened automatically.
Downloads will fail if the internet connection cuts out, so make sure you have a strong internet connection. You could try disconnecting your device from the internet and reconnecting to see if that helps. If you're using WiFi, resetting the network at the router can also make a difference.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With