A download file name becomes garbled with some browser when the "filename" parameter contains specific multi-byte characters even if the "filename*" parameter is specified correctly in the "Content-Disposition" response header in JBoss EAP 7

Solution Unverified - Updated -

Issue

A download file name becomes garbled in some browsers (firefox) when the filename parameter of the Content-Disposition: attachment response header contains specific multi-byte characters (Japanese kanji character or full-width space   like the following example code). The issue happens even if the filename* parameter is specified correctly with URL encoded strings in the Content-Disposition: attachment response header:

String filename = "テストファイル一覧.xls";
response.setHeader("Content-disposition","attachment; filename=\"" + filename + "\"; filename*=UTF-8''" + java.net.URLEncoder.encode(filename, "UTF-8"));

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content