Android Chrome browser unnecessarily renames names & types of downloaded files

前端 未结 3 1313
暗喜
暗喜 2021-01-28 23:41

I thought I\'d repost this since I have more detailed information:

THE ISSUE: Android Chrome browser renames a file to \"Download\" in all cases. It renames the type t

相关标签:
3条回答
  • 2021-01-29 00:11

    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:

    • http://code.google.com/p/android/issues/detail?id=11422
    • Android browser/webview bug? Content-Disposition: attachment; filename="xyz.txt"
    • http://code.google.com/p/android/issues/detail?id=9991
    • http://thedigiblog.wordpress.com/2011/04/19/android-and-the-download-file-headers/
    0 讨论(0)
  • 2021-01-29 00:28

    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.

    0 讨论(0)
  • 2021-01-29 00:30

    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.

    0 讨论(0)
提交回复
热议问题