Android Chrome browser unnecessarily renames names & types of downloaded files

百般思念 提交于 2019-12-02 10:01:58
CommonsWare

Content-Disposition has a history of being a problem on Android. You are certainly welcome to try removing the UTF-8 part and see if that helps Chrome. But definitely test the original Android Browser app as well, as numerically that's the most popular browser for Android.

See also:

Anton Laptashev

I had a similar problem with downloads on Chrome/Android. .docx files were renamed to filename.bin (or something like that).

Headers included

Content-Type:application/octet-stream

and

Content-Disposition:attachment; filename="something.docx";

Turned out that my problem was in trailing semicolon in "Content-Disposition" header. When there is no semicolon at the end of the line - it works fine:

Content-Disposition:attachment; filename="something.docx"

More info here: http://www.digiblog.de/2011/04/android-and-the-download-file-headers/

So, be sure to check that as well.

Kinlan

This a duplicate of a previous question we answered live on air and on SO here https://stackoverflow.com/questions/17266320/chrome-browser-in-android-always-renames-downloaded-file-to-download-bin which has been deleted.

This will be fixed in the next refresh especially via the a[download] attribute.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!